npm ERR phantomjs@1.9.16安装:'node install.js'

时间:2015-05-17 23:29:25

标签: npm phantomjs meanjs

我正在做教程:http://www.bradoncode.com/tutorials/mean-stack-tutorial-part-1-setup/

尝试安装wordF :: [String] -> String -> String -> (String, String, Int) wordF [] a b = (a, b, -1) wordF list a b | (notElem a list || notElem b list) = (a, b, -1) | otherwise = (a, b, (wordF1 list a b)) wordF1 :: [String] -> String -> String -> Int wordF1 list a b | ((map length (wordF2 (subconjuntos2 (subconjuntos list) a b))) == []) = -1 | (calculo > 0) = calculo | otherwise = -1 where calculo = (minimum (map length (wordF2 (subconjuntos2 (subconjuntos list) a b))))-1 wordF2 :: [[String]] -> [[String]] wordF2 [[]] = [] wordF2 (x:xs) | ((length xs == 1) && ((check_word x) == True) && ((check_word (head xs)) == True)) = x:xs | ((length xs == 1) && ((check_word x) == False) && ((check_word (head xs)) == True)) = xs | ((length xs == 1) && ((check_word x) == True) && ((check_word (head xs)) == False)) = [x] | ((length xs == 1) && ((check_word x) == False) && ((check_word (head xs)) == False)) = [] | ((check_word x) == True) = x:wordF2 xs | ((check_word x) == False ) = wordF2 xs check_word :: [String] -> Bool check_word [] = False check_word (x:xs) | ((length xs == 1) && ((check_word2 x (head xs) 0) == True)) = True | ((length xs >1) && ((check_word2 x (head xs) 0) == True)) = True && (check_word xs) | otherwise = False check_word2 :: String -> String -> Int -> Bool check_word2 word1 word2 dif | (dif > 1) = False | ((length word1 == 1) && (length word2 == 1) && (head word1 == head word2)) = True | ((length word1 == 1) && (length word2 == 1) && (head word1 /= head word2) && (dif<1)) = True | ((head word1) == (head word2)) = check_word2 (tail word1) (tail word2) dif | otherwise = check_word2 (tail word1) (tail word2) (dif+1) subconjuntos2 :: [[String]] -> String -> String -> [[String]] subconjuntos2 [] a b = [] subconjuntos2 (x:xs) a b | (length x <= 1) = subconjuntos2 xs a b | ((head x == a) && (last x == b)) = (x:subconjuntos2 xs a b) | ((head x /= a) || (last x /= b)) = (subconjuntos2 xs a b) subconjuntos :: [a] -> [[a]] subconjuntos [] = [[]] subconjuntos (x:xs) = [x:ys | ys <- sub] ++ sub where sub = subconjuntos xs 。一切都差不多但最后由于meanjs安装失败而导致安装失败。

这是输出的错误日志:

phantomjs

我在安装了节点v0.10.31的Windows 7上。

1 个答案:

答案 0 :(得分:1)

我尝试安装phantomjs时遇到了同样的错误,并最终通过手动安装phantomjs和依赖它的软件包解决了这个问题:

  1. 在此处抓取来源:https://github.com/Medium/phantomjs
  2. 把它放在一个文件夹&#34; phantomjs&#34;并把它放在&#34; node_modules&#34;项目的文件夹或依赖于phantomjs的模块。
  3. 导航到&#34; phantomjs&#34;并运行&#34; node ./install.js"
  4. 此时,我收到一条错误消息,说明&#34;请求进度&#34; (找不到幻影的依赖之一)无法找到。这可能解释了为什么我们在phantomjs@1.9.16安装脚本中点击了#n; npm ERR失败。&#34;当我们尝试使用npm安装它时。当您仍然在phantomjs文件夹中时,运行&#34; npm install request-progress。&#34;现在如果你运行&#34; node ./install.js"再次,它应该工作。
  5. 在我的情况下,我试图安装模块html5-to-pdf,一个phantomjs的依赖。如果我尝试&#34; npm安装html5-to-pdf&#34;我仍然会收到关于phantomjs的错误。然后我将html5-to-pdf源复制到我的项目中并放入&#34; phantomjs&#34; html5-to-pdf的node_modules文件夹下的文件夹。然后我跑了&#34; npm install&#34;对于除了phantomjs之外的每个html5到pdf的依赖项。
  6. 最后,当我跑了&#34; npm install&#34;和&#34; npm update&#34;在我的根项目文件夹中,我不再有任何关于phantomjs的错误。我刚刚确认phantomjs实际上正在我的项目中工作。
  7. 也许有更好的解决方法,但是在整天尝试各种想法后,只有这对我有用。祝你好运!

相关问题