2015-09-18 237 views
0
# cat /etc/redhat-release 
CentOS release 6.7 (Final) 

當我運行npm prune && npm install && bower install && gulp buildNPM安裝找不到模塊

我得到

> [email protected] 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 

> [email protected] 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! [email protected] install: `node install.js` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 

我運行節點和NPM的一個新版本的錯誤。

# node --version 
v0.12.7 
# npm --version 
2.11.3 
# echo $NODE_PATH 
/usr/local/lib/node_modules/ 

這裏是我的package.json

{ 
    "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" 
    } 
} 

而且bower.json

{ 
    "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" 
    } 
} 

我絕對不是一個前端開發人員,我一直停留在這一天左右了。問題是什麼?

回答

0

問題似乎是你似乎沒有安裝Phantom JS。

由於您在CentOS上,因此在發佈此答案時,根據Phantom JS download page,建議您從源代碼構建Linux版本。

幻影JS爲Linux仍在準備

的Linux二進制軟件包。在靜態構建可用之前仍有問題需要解決(有關更多詳細信息,請參閱問題12948)。

與此同時,建議您從源代碼構建Linux版本。

http://phantomjs.org/download.html