Node.js npm安装找不到模块

Node.js npm安装找不到模块,node.js,centos,npm,phantomjs,Node.js,Centos,Npm,Phantomjs,当我运行npm prune&&npm安装&&bower安装&&gulp build时 我得到了错误 # cat /etc/redhat-release CentOS release 6.7 (Final) 我正在运行node和npm的新版本 > phantomjs@1.9.18 install /root/.builds/blog-theme/node_modules/gulp-uncss/node_modules/uncss/node_modules/phridge/node_modu

当我运行npm prune&&npm安装&&bower安装&&gulp build时

我得到了错误

# cat /etc/redhat-release
CentOS release 6.7 (Final)
我正在运行node和npm的新版本

> phantomjs@1.9.18 install /root/.builds/blog-theme/node_modules/gulp-uncss/node_modules/uncss/node_modules/phridge/node_modules/phantomjs
> node install.js

module.js:338
    throw err;
          ^
Error: Cannot find module '/root/.builds/blog-theme/node_modules/gulp-uncss/node_modules/uncss/node_modules/phridge/node_modules/phantomjs/install.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

> spawn-sync@1.0.13 postinstall /root/.builds/blog-theme/node_modules/gulp-sass/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

module.js:338
    throw err;
          ^
Error: Cannot find module '/root/.builds/blog-theme/node_modules/gulp-sass/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync/postinstall'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
npm ERR! Linux 2.6.32-573.3.1.el6.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! phantomjs@1.9.18 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.18 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.builds/blog-theme/npm-debug.log
这是我的package.json

和bower.json


我绝对不是一个前端开发人员,我已经在这上面呆了大约一天了。可能是什么问题?

问题似乎是您没有安装Phantom JS

由于您在CentOS上,根据发布此答案时,建议您从源代码构建Linux版本

适用于Linux的Phantom JS Linux的二进制软件包仍在准备中。在静态构建可用之前,仍有一些问题需要解决。有关更多详细信息,请参阅问题12948

同时,建议您从源代码构建Linux版本

# node --version
v0.12.7
# npm --version
2.11.3
# echo $NODE_PATH
/usr/local/lib/node_modules/
{
  "name": "blog-theme",
  "version": "1.0.8",
  "description": "Blog theme",
  "repository": {
    "type": "git",
    "url": "git://some.url.com/blog-theme.git"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "UNLICENSED",
  "private": true,
  "devDependencies": {
    "bower": "^1.4.1",
    "glob": "^5.0.10",
    "gulp": "^3.9.0",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-bump": "^0.3.1",
    "gulp-filter": "^2.0.2",
    "gulp-git": "^1.2.4",
    "gulp-jshint": "^1.11.0",
    "gulp-load-plugins": "^0.10.0",
    "gulp-minify-css": "^1.1.6",
    "gulp-plumber": "^1.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^2.0.1",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-tag-version": "^1.2.1",
    "gulp-uglify": "^1.2.0",
    "gulp-uncss": "^1.0.1",
    "jshint-stylish": "^0.4.0",
    "lodash": "^3.9.3"
  }
}
{
  "name": "blog-theme",
  "version": "1.0.8",
  "description": "Blog theme",
  "license": "None granted",
  "private": true,
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "bootstrap-sass-official": "~3.2.0",
    "font-awesome": "~4.2.0"
  }
}