如何在同一操作系统中管理不同版本的node.js?
How to manage different versions of node.js in same operating system?
我已经安装了 node.js v8.6.0,我正在尝试 运行 v.4.4.3 开发 npm 模块。它造成了这样的问题:
$ yo angular-scalatra
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
|a|n|g|u|l|a|r| |s|c|a|l|a|t|r|a| |g|e|n|e|r|a|t|o|r|
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
[?] What is the name of your application? myapp
[?] What is your default package name? com.mycompany.myapp
create generator.json
create package.json
create bower.json
identical .bowerrc
create Gruntfile.js
identical .gitignore
create sbt
create assembly.sbt
create project/build.properties
create project/build.scala
create project/plugins.sbt
create src/main/resources/logback.xml
create src/main/scala/JettyLauncher.scala
create src/main/scala/ScalatraBootstrap.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseInit.scala
create src/main/scala/com/mycompany/myapp/json/DateSerializer.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseSessionSupport.scala
create src/main/scala/com/mycompany/myapp/models/ScalatraRecord.scala
create src/main/webapp/WEB-INF/web.xml
create src/main/webapp/index.html
create src/main/webapp/css/app.css
create src/main/webapp/js/app.js
create src/main/webapp/js/home/home-controller.js
create src/main/webapp/views/home/home.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN deprecated grunt-ngmin@0.0.3: use grunt-ng-annotate instead
npm WARN deprecated bower@1.2.8: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated connect@2.7.11: connect 2.x series is deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated ngmin@0.4.1: use ng-annotate instead
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated connect@2.8.8: connect 2.x series is deprecated
npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated find-file@0.1.4: Use the globby package instead
> ws@0.4.32 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:97: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/ws/build'
> gifsicle@0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/gifsicle
> node index.js
path.js:28
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/gifsicle-bin/v0.1.7/vendor/linux/x64/gifsicle',
name: 'gifsicle',
os: 'linux',
arch: 'x64' }
at assertPath (path.js:28:11)
at Object.basename (path.js:1397:5)
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/download/index.js:35:43
at each (/home/limitless/Documents/projects/test/scala/myapp/node_modules/each-async/each-async.js:63:4)
at module.exports (/home/limitless/Documents/projects/test/scala/myapp/node_modules/download/index.js:33:5)
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-wrapper/index.js:108:20
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-wrapper/index.js:141:24
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-check/index.js:30:20
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/executable/index.js:39:20
at FSReqWrap.oncomplete (fs.js:153:21)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@0.2.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN karma@0.10.10 requires a peer of karma-requirejs@~0.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-coffee-preprocessor@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-html2js-preprocessor@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-chrome-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-firefox-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-phantomjs-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-script-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN myapp@0.0.0 No repository field.
npm WARN myapp@0.0.0 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gifsicle@0.1.7 postinstall: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gifsicle@0.1.7 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/limitless/.npm/_logs/2017-10-16T16_19_21_976Z-debug.log
所以我无法运行申请。你能帮我解决这个问题吗?
错误消息说 "Path must be a string",并表明它收到的 path
是一个对象,而不是字符串。
也许您应该使用 path.url
而不是 path
?
(猜测而已,问这类问题的时候应该出示相关代码)
我解决了 nvm(节点版本管理器)和 V4.4.3 的安装问题 node.js
1) 安装 nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
2) 如果安装完成则打开新终端并列出安装的节点版本。
nvm ls
nvm ls
-> system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
3) 安装 node.js 你想要的版本 ex.V4.4.3
nvm install v4.4.3
4) 设置默认版本 node.js
nvm alias default v4.4.3
5) 运行 你的申请
$ yo angular-scalatra
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
|a|n|g|u|l|a|r| |s|c|a|l|a|t|r|a| |g|e|n|e|r|a|t|o|r|
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
[?] What is the name of your application? myapp
[?] What is your default package name? com.mycompany.myapp
create generator.json
create package.json
create bower.json
identical .bowerrc
create Gruntfile.js
identical .gitignore
create sbt
create assembly.sbt
create project/build.properties
create project/build.scala
create project/plugins.sbt
create src/main/resources/logback.xml
create src/main/scala/JettyLauncher.scala
create src/main/scala/ScalatraBootstrap.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseInit.scala
create src/main/scala/com/mycompany/myapp/json/DateSerializer.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseSessionSupport.scala
create src/main/scala/com/mycompany/myapp/models/ScalatraRecord.scala
create src/main/webapp/WEB-INF/web.xml
create src/main/webapp/index.html
create src/main/webapp/css/app.css
create src/main/webapp/js/app.js
create src/main/webapp/js/home/home-controller.js
create src/main/webapp/views/home/home.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN package.json myapp@0.0.0 No repository field.
npm WARN package.json myapp@0.0.0 No README data
npm WARN package.json myapp@0.0.0 No license field.
npm WARN deprecated grunt-ngmin@0.0.3: use grunt-ng-annotate instead
npm WARN engine karma@0.10.10: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN deprecated ngmin@0.4.1: use ng-annotate instead
npm WARN deprecated bower@1.2.8: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated connect@2.7.11: connect 2.x series is deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN peerDependencies The peer dependency karma-requirejs@~0.2.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-coffee-preprocessor@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-html2js-preprocessor@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-chrome-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-firefox-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-phantomjs-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-script-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated connect@2.8.8: connect 2.x series is deprecated
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated find-file@0.1.4: Use the globby package instead
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> grunt-autoprefixer@0.4.2 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-autoprefixer
>
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN optional dep failed, continuing fsevents@0.2.1
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
> pngquant-bin@0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin
> node index.js
✓ pre-build test passed successfully
> optipng-bin@0.3.11 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node index.js
✔ pre-build test passed successfully!
> jpegtran-bin@0.2.8 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node index.js
✔ pre-build test passed successfully!
> gifsicle@0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/gifsicle
> node index.js
✔ pre-build test passed successfully!
> ws@0.4.32 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:92: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
npm WARN peerDependencies The peer dependency requirejs@^2.1.0 included from karma-requirejs will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
/
> phantomjs@1.9.20 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
[========================================] 99%
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1508170953450/phantomjs-1.9.8-linux-x86_64 -> /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
karma-jasmine@0.1.6 node_modules/karma-jasmine
grunt-rev@0.1.0 node_modules/grunt-rev
karma-ng-scenario@0.1.0 node_modules/karma-ng-scenario
grunt-contrib-concat@0.3.0 node_modules/grunt-contrib-concat
grunt-contrib-copy@0.4.1 node_modules/grunt-contrib-copy
karma-junit-reporter@0.1.0 node_modules/karma-junit-reporter
└── xmlbuilder@0.4.2
grunt-contrib-clean@0.5.0 node_modules/grunt-contrib-clean
└── rimraf@2.2.8
grunt-sync@0.0.8 node_modules/grunt-sync
└── promised-io@0.3.3
grunt-concurrent@0.4.3 node_modules/grunt-concurrent
├── lpad@0.1.0
└── async@0.2.10
time-grunt@0.2.3 node_modules/time-grunt
├── ms@0.6.2
├── hooker@0.2.3
├── text-table@0.2.0
└── chalk@0.3.0 (has-color@0.1.7, ansi-styles@0.2.0)
grunt-contrib-htmlmin@0.1.3 node_modules/grunt-contrib-htmlmin
├── html-minifier@0.5.6
└── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
grunt-connect-proxy@0.2.0 node_modules/grunt-connect-proxy
├── lodash@0.9.2
└── http-proxy@1.11.3 (eventemitter3@1.2.0, requires-port@0.0.1)
grunt-contrib-cssmin@0.7.0 node_modules/grunt-contrib-cssmin
├── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
└── clean-css@2.0.8 (commander@2.0.0)
grunt-karma@0.6.2 node_modules/grunt-karma
└── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
grunt-usemin@2.0.2 node_modules/grunt-usemin
├── debug@0.7.4
└── lodash@1.0.2
load-grunt-tasks@0.2.1 node_modules/load-grunt-tasks
├── globule@0.1.0 (lodash@1.0.2, glob@3.1.21, minimatch@0.2.14)
└── findup-sync@0.1.3 (lodash@2.4.2, glob@3.2.11)
grunt-svgmin@0.3.1 node_modules/grunt-svgmin
├── each-async@0.1.3
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
└── svgo@0.4.5 (colors@0.6.2, whet.extend@0.9.9, sax@0.6.1, coa@0.4.1, js-yaml@2.1.3)
grunt-autoprefixer@0.4.2 node_modules/grunt-autoprefixer
└── autoprefixer@0.8.20131213 (css-parse@1.6.0, css-stringify@1.4.1)
grunt-contrib-connect@0.5.0 node_modules/grunt-contrib-connect
├── connect-livereload@0.2.0
├── open@0.0.4
└── connect@2.7.11 (fresh@0.1.0, qs@0.6.5, pause@0.0.1, cookie-signature@1.0.1, buffer-crc32@0.2.1, bytes@0.2.0, cookie@0.0.5, formidable@1.0.14, debug@3.1.0, send@0.1.1)
grunt-contrib-watch@0.5.3 node_modules/grunt-contrib-watch
├── gaze@0.4.3 (globule@0.1.0)
└── tiny-lr@0.0.4 (debug@0.7.4, qs@0.5.6, faye-websocket@0.4.4, noptify@0.0.3)
grunt-bower-install@0.7.0 node_modules/grunt-bower-install
└── wiredep@0.4.2 (chalk@0.1.1, lodash@1.3.1)
grunt-contrib-uglify@0.2.7 node_modules/grunt-contrib-uglify
├── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
└── uglify-js@2.4.24 (async@0.2.10, uglify-to-browserify@1.0.2, yargs@3.5.4, source-map@0.1.34)
grunt-ngmin@0.0.3 node_modules/grunt-ngmin
└── ngmin@0.4.1 (astral@0.1.0, clone@0.1.19, esprima@1.0.4, commander@1.1.1, astral-angular-annotate@0.0.2, escodegen@0.0.28)
grunt-contrib-jshint@0.7.2 node_modules/grunt-contrib-jshint
└── jshint@2.3.0 (console-browserify@0.1.6, underscore@1.4.4, minimatch@0.4.0, shelljs@0.1.4, cli@0.4.5)
grunt@0.4.5 node_modules/grunt
├── eventemitter2@0.4.14
├── dateformat@1.0.2-1.2.3
├── which@1.0.9
├── getobject@0.1.0
├── async@0.1.22
├── colors@0.6.2
├── lodash@0.9.2
├── rimraf@2.2.8
├── hooker@0.2.3
├── grunt-legacy-util@0.2.0
├── exit@0.1.2
├── nopt@1.0.10 (abbrev@1.1.1)
├── coffee-script@1.3.3
├── iconv-lite@0.2.11
├── underscore.string@2.2.1
├── glob@3.1.21 (inherits@1.0.2, graceful-fs@1.2.3)
├── minimatch@0.2.14 (sigmund@1.0.1, lru-cache@2.7.3)
├── grunt-legacy-log@0.1.3 (grunt-legacy-log-utils@0.1.1, lodash@2.4.2, underscore.string@2.3.3)
├── findup-sync@0.1.3 (lodash@2.4.2, glob@3.2.11)
└── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.16)
grunt-modernizr@0.4.1 node_modules/grunt-modernizr
├── colors@0.6.2
├── promised-io@0.3.5
├── uglify-js@1.3.3
└── request@2.27.0 (aws-sign@0.3.0, forever-agent@0.5.2, tunnel-agent@0.3.0, qs@0.6.6, oauth-sign@0.3.0, mime@1.2.11, json-stringify-safe@5.0.1, cookie-jar@0.3.0, node-uuid@1.4.8, http-signature@0.10.1, hawk@1.0.0, form-data@0.1.4)
grunt-bowercopy@0.4.1 node_modules/grunt-bowercopy
├── lodash@2.4.2
└── bower@1.2.8 (stringify-object@0.1.8, junk@0.2.2, abbrev@1.0.9, which@1.0.9, osenv@0.0.3, graceful-fs@2.0.3, open@0.0.5, nopt@2.1.2, bower-endpoint-parser@0.2.2, chmodr@0.1.2, bower-logger@0.2.2, archy@0.0.2, p-throttler@0.0.1, q@0.9.7, rimraf@2.2.8, lru-cache@2.3.1, retry@0.6.1, semver@2.1.0, chalk@0.2.1, mkdirp@0.3.5, tmp@0.0.33, sudo-block@0.2.1, request-progress@0.3.1, bower-json@0.4.0, glob@3.2.11, fstream-ignore@0.0.10, tar@0.1.20, promptly@0.2.1, fstream@0.1.31, cardinal@0.4.4, request@2.27.0, decompress-zip@0.0.8, handlebars@1.0.12, inquirer@0.3.5, mout@0.7.1, bower-config@0.5.3, update-notifier@0.1.10, bower-registry-client@0.1.6)
grunt-contrib-imagemin@0.4.1 node_modules/grunt-contrib-imagemin
├── filesize@2.0.4
├── async@0.2.10
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── pngquant-bin@0.1.7 (bin-wrapper@0.2.4)
├── optipng-bin@0.3.11 (log-symbols@1.0.2, bin-wrapper@0.3.4, bin-build@0.1.1)
├── jpegtran-bin@0.2.8 (log-symbols@1.0.2, bin-wrapper@0.3.4, bin-build@0.1.1)
└── gifsicle@0.1.7 (log-symbols@1.0.2, bin-wrapper@0.3.4, bin-build@0.1.1)
karma-script-launcher@0.1.0 node_modules/karma-script-launcher
karma-firefox-launcher@0.1.7 node_modules/karma-firefox-launcher
karma-html2js-preprocessor@0.1.0 node_modules/karma-html2js-preprocessor
karma-chrome-launcher@0.1.12 node_modules/karma-chrome-launcher
└── which@1.3.0 (isexe@2.0.0)
karma-coffee-preprocessor@0.1.3 node_modules/karma-coffee-preprocessor
└── coffee-script@1.7.1 (mkdirp@0.3.5)
requirejs@2.3.5 node_modules/requirejs
karma-requirejs@0.2.6 node_modules/karma-requirejs
karma-phantomjs-launcher@0.1.4 node_modules/karma-phantomjs-launcher
└── phantomjs@1.9.20 (progress@1.1.8, kew@0.7.0, which@1.2.14, request-progress@2.0.1, hasha@2.2.0, extract-zip@1.5.0, fs-extra@0.26.7, request@2.67.0)
karma@0.10.10 node_modules/karma
├── colors@0.6.0-1
├── di@0.0.1
├── graceful-fs@1.2.3
├── mime@1.2.11
├── rimraf@2.1.4
├── q@0.9.7
├── lodash@1.1.1
├── coffee-script@1.6.3
├── minimatch@0.2.14 (sigmund@1.0.1, lru-cache@2.7.3)
├── glob@3.1.21 (inherits@1.0.2)
├── optimist@0.3.7 (wordwrap@0.0.3)
├── useragent@2.0.10 (lru-cache@2.2.4)
├── log4js@0.6.38 (semver@4.3.6, readable-stream@1.0.34)
├── chokidar@0.8.4 (recursive-readdir@0.0.2)
├── connect@2.8.8 (methods@0.0.1, uid2@0.0.2, qs@0.6.5, cookie-signature@1.0.1, pause@0.0.1, buffer-crc32@0.2.1, bytes@0.2.0, fresh@0.2.0, cookie@0.1.0, send@0.1.4, debug@3.1.0, formidable@1.0.14)
├── http-proxy@0.10.4 (colors@0.6.2, pkginfo@0.3.1, optimist@0.6.1, utile@0.2.1)
└── socket.io@0.9.19 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)
解决方法是n先安装打字
npm install -g n
然后用
安装
sudo n 4.4.3
此安装将设置您的节点 js 版本以在系统中使用
我已经安装了 node.js v8.6.0,我正在尝试 运行 v.4.4.3 开发 npm 模块。它造成了这样的问题:
$ yo angular-scalatra
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
|a|n|g|u|l|a|r| |s|c|a|l|a|t|r|a| |g|e|n|e|r|a|t|o|r|
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
[?] What is the name of your application? myapp
[?] What is your default package name? com.mycompany.myapp
create generator.json
create package.json
create bower.json
identical .bowerrc
create Gruntfile.js
identical .gitignore
create sbt
create assembly.sbt
create project/build.properties
create project/build.scala
create project/plugins.sbt
create src/main/resources/logback.xml
create src/main/scala/JettyLauncher.scala
create src/main/scala/ScalatraBootstrap.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseInit.scala
create src/main/scala/com/mycompany/myapp/json/DateSerializer.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseSessionSupport.scala
create src/main/scala/com/mycompany/myapp/models/ScalatraRecord.scala
create src/main/webapp/WEB-INF/web.xml
create src/main/webapp/index.html
create src/main/webapp/css/app.css
create src/main/webapp/js/app.js
create src/main/webapp/js/home/home-controller.js
create src/main/webapp/views/home/home.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN deprecated grunt-ngmin@0.0.3: use grunt-ng-annotate instead
npm WARN deprecated bower@1.2.8: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated connect@2.7.11: connect 2.x series is deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated ngmin@0.4.1: use ng-annotate instead
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated connect@2.8.8: connect 2.x series is deprecated
npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated find-file@0.1.4: Use the globby package instead
> ws@0.4.32 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:97: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/ws/build'
> gifsicle@0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/gifsicle
> node index.js
path.js:28
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/gifsicle-bin/v0.1.7/vendor/linux/x64/gifsicle',
name: 'gifsicle',
os: 'linux',
arch: 'x64' }
at assertPath (path.js:28:11)
at Object.basename (path.js:1397:5)
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/download/index.js:35:43
at each (/home/limitless/Documents/projects/test/scala/myapp/node_modules/each-async/each-async.js:63:4)
at module.exports (/home/limitless/Documents/projects/test/scala/myapp/node_modules/download/index.js:33:5)
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-wrapper/index.js:108:20
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-wrapper/index.js:141:24
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/bin-check/index.js:30:20
at /home/limitless/Documents/projects/test/scala/myapp/node_modules/executable/index.js:39:20
at FSReqWrap.oncomplete (fs.js:153:21)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@0.2.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN karma@0.10.10 requires a peer of karma-requirejs@~0.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-coffee-preprocessor@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-html2js-preprocessor@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-chrome-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-firefox-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-phantomjs-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN karma@0.10.10 requires a peer of karma-script-launcher@~0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN myapp@0.0.0 No repository field.
npm WARN myapp@0.0.0 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gifsicle@0.1.7 postinstall: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gifsicle@0.1.7 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/limitless/.npm/_logs/2017-10-16T16_19_21_976Z-debug.log
所以我无法运行申请。你能帮我解决这个问题吗?
错误消息说 "Path must be a string",并表明它收到的 path
是一个对象,而不是字符串。
也许您应该使用 path.url
而不是 path
?
(猜测而已,问这类问题的时候应该出示相关代码)
我解决了 nvm(节点版本管理器)和 V4.4.3 的安装问题 node.js
1) 安装 nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
2) 如果安装完成则打开新终端并列出安装的节点版本。
nvm ls
nvm ls
-> system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
3) 安装 node.js 你想要的版本 ex.V4.4.3
nvm install v4.4.3
4) 设置默认版本 node.js
nvm alias default v4.4.3
5) 运行 你的申请
$ yo angular-scalatra
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
|a|n|g|u|l|a|r| |s|c|a|l|a|t|r|a| |g|e|n|e|r|a|t|o|r|
+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+
[?] What is the name of your application? myapp
[?] What is your default package name? com.mycompany.myapp
create generator.json
create package.json
create bower.json
identical .bowerrc
create Gruntfile.js
identical .gitignore
create sbt
create assembly.sbt
create project/build.properties
create project/build.scala
create project/plugins.sbt
create src/main/resources/logback.xml
create src/main/scala/JettyLauncher.scala
create src/main/scala/ScalatraBootstrap.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseInit.scala
create src/main/scala/com/mycompany/myapp/json/DateSerializer.scala
create src/main/scala/com/mycompany/myapp/data/DatabaseSessionSupport.scala
create src/main/scala/com/mycompany/myapp/models/ScalatraRecord.scala
create src/main/webapp/WEB-INF/web.xml
create src/main/webapp/index.html
create src/main/webapp/css/app.css
create src/main/webapp/js/app.js
create src/main/webapp/js/home/home-controller.js
create src/main/webapp/views/home/home.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN package.json myapp@0.0.0 No repository field.
npm WARN package.json myapp@0.0.0 No README data
npm WARN package.json myapp@0.0.0 No license field.
npm WARN deprecated grunt-ngmin@0.0.3: use grunt-ng-annotate instead
npm WARN engine karma@0.10.10: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN deprecated ngmin@0.4.1: use ng-annotate instead
npm WARN deprecated bower@1.2.8: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated connect@2.7.11: connect 2.x series is deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN peerDependencies The peer dependency karma-requirejs@~0.2.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-coffee-preprocessor@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-html2js-preprocessor@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-chrome-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-firefox-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-phantomjs-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma-script-launcher@~0.1.0 included from karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated connect@2.8.8: connect 2.x series is deprecated
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated find-file@0.1.4: Use the globby package instead
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> grunt-autoprefixer@0.4.2 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-autoprefixer
>
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"})
npm WARN optional dep failed, continuing fsevents@0.2.1
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
> pngquant-bin@0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin
> node index.js
✓ pre-build test passed successfully
> optipng-bin@0.3.11 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node index.js
✔ pre-build test passed successfully!
> jpegtran-bin@0.2.8 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node index.js
✔ pre-build test passed successfully!
> gifsicle@0.1.7 postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/gifsicle
> node index.js
✔ pre-build test passed successfully!
> ws@0.4.32 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:92: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/limitless/Documents/projects/test/scala/myapp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
npm WARN peerDependencies The peer dependency requirejs@^2.1.0 included from karma-requirejs will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
/
> phantomjs@1.9.20 install /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
[========================================] 99%
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1508170953450/phantomjs-1.9.8-linux-x86_64 -> /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/limitless/Documents/projects/test/scala/myapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
karma-jasmine@0.1.6 node_modules/karma-jasmine
grunt-rev@0.1.0 node_modules/grunt-rev
karma-ng-scenario@0.1.0 node_modules/karma-ng-scenario
grunt-contrib-concat@0.3.0 node_modules/grunt-contrib-concat
grunt-contrib-copy@0.4.1 node_modules/grunt-contrib-copy
karma-junit-reporter@0.1.0 node_modules/karma-junit-reporter
└── xmlbuilder@0.4.2
grunt-contrib-clean@0.5.0 node_modules/grunt-contrib-clean
└── rimraf@2.2.8
grunt-sync@0.0.8 node_modules/grunt-sync
└── promised-io@0.3.3
grunt-concurrent@0.4.3 node_modules/grunt-concurrent
├── lpad@0.1.0
└── async@0.2.10
time-grunt@0.2.3 node_modules/time-grunt
├── ms@0.6.2
├── hooker@0.2.3
├── text-table@0.2.0
└── chalk@0.3.0 (has-color@0.1.7, ansi-styles@0.2.0)
grunt-contrib-htmlmin@0.1.3 node_modules/grunt-contrib-htmlmin
├── html-minifier@0.5.6
└── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
grunt-connect-proxy@0.2.0 node_modules/grunt-connect-proxy
├── lodash@0.9.2
└── http-proxy@1.11.3 (eventemitter3@1.2.0, requires-port@0.0.1)
grunt-contrib-cssmin@0.7.0 node_modules/grunt-contrib-cssmin
├── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
└── clean-css@2.0.8 (commander@2.0.0)
grunt-karma@0.6.2 node_modules/grunt-karma
└── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
grunt-usemin@2.0.2 node_modules/grunt-usemin
├── debug@0.7.4
└── lodash@1.0.2
load-grunt-tasks@0.2.1 node_modules/load-grunt-tasks
├── globule@0.1.0 (lodash@1.0.2, glob@3.1.21, minimatch@0.2.14)
└── findup-sync@0.1.3 (lodash@2.4.2, glob@3.2.11)
grunt-svgmin@0.3.1 node_modules/grunt-svgmin
├── each-async@0.1.3
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
└── svgo@0.4.5 (colors@0.6.2, whet.extend@0.9.9, sax@0.6.1, coa@0.4.1, js-yaml@2.1.3)
grunt-autoprefixer@0.4.2 node_modules/grunt-autoprefixer
└── autoprefixer@0.8.20131213 (css-parse@1.6.0, css-stringify@1.4.1)
grunt-contrib-connect@0.5.0 node_modules/grunt-contrib-connect
├── connect-livereload@0.2.0
├── open@0.0.4
└── connect@2.7.11 (fresh@0.1.0, qs@0.6.5, pause@0.0.1, cookie-signature@1.0.1, buffer-crc32@0.2.1, bytes@0.2.0, cookie@0.0.5, formidable@1.0.14, debug@3.1.0, send@0.1.1)
grunt-contrib-watch@0.5.3 node_modules/grunt-contrib-watch
├── gaze@0.4.3 (globule@0.1.0)
└── tiny-lr@0.0.4 (debug@0.7.4, qs@0.5.6, faye-websocket@0.4.4, noptify@0.0.3)
grunt-bower-install@0.7.0 node_modules/grunt-bower-install
└── wiredep@0.4.2 (chalk@0.1.1, lodash@1.3.1)
grunt-contrib-uglify@0.2.7 node_modules/grunt-contrib-uglify
├── grunt-lib-contrib@0.6.1 (zlib-browserify@0.0.1)
└── uglify-js@2.4.24 (async@0.2.10, uglify-to-browserify@1.0.2, yargs@3.5.4, source-map@0.1.34)
grunt-ngmin@0.0.3 node_modules/grunt-ngmin
└── ngmin@0.4.1 (astral@0.1.0, clone@0.1.19, esprima@1.0.4, commander@1.1.1, astral-angular-annotate@0.0.2, escodegen@0.0.28)
grunt-contrib-jshint@0.7.2 node_modules/grunt-contrib-jshint
└── jshint@2.3.0 (console-browserify@0.1.6, underscore@1.4.4, minimatch@0.4.0, shelljs@0.1.4, cli@0.4.5)
grunt@0.4.5 node_modules/grunt
├── eventemitter2@0.4.14
├── dateformat@1.0.2-1.2.3
├── which@1.0.9
├── getobject@0.1.0
├── async@0.1.22
├── colors@0.6.2
├── lodash@0.9.2
├── rimraf@2.2.8
├── hooker@0.2.3
├── grunt-legacy-util@0.2.0
├── exit@0.1.2
├── nopt@1.0.10 (abbrev@1.1.1)
├── coffee-script@1.3.3
├── iconv-lite@0.2.11
├── underscore.string@2.2.1
├── glob@3.1.21 (inherits@1.0.2, graceful-fs@1.2.3)
├── minimatch@0.2.14 (sigmund@1.0.1, lru-cache@2.7.3)
├── grunt-legacy-log@0.1.3 (grunt-legacy-log-utils@0.1.1, lodash@2.4.2, underscore.string@2.3.3)
├── findup-sync@0.1.3 (lodash@2.4.2, glob@3.2.11)
└── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.16)
grunt-modernizr@0.4.1 node_modules/grunt-modernizr
├── colors@0.6.2
├── promised-io@0.3.5
├── uglify-js@1.3.3
└── request@2.27.0 (aws-sign@0.3.0, forever-agent@0.5.2, tunnel-agent@0.3.0, qs@0.6.6, oauth-sign@0.3.0, mime@1.2.11, json-stringify-safe@5.0.1, cookie-jar@0.3.0, node-uuid@1.4.8, http-signature@0.10.1, hawk@1.0.0, form-data@0.1.4)
grunt-bowercopy@0.4.1 node_modules/grunt-bowercopy
├── lodash@2.4.2
└── bower@1.2.8 (stringify-object@0.1.8, junk@0.2.2, abbrev@1.0.9, which@1.0.9, osenv@0.0.3, graceful-fs@2.0.3, open@0.0.5, nopt@2.1.2, bower-endpoint-parser@0.2.2, chmodr@0.1.2, bower-logger@0.2.2, archy@0.0.2, p-throttler@0.0.1, q@0.9.7, rimraf@2.2.8, lru-cache@2.3.1, retry@0.6.1, semver@2.1.0, chalk@0.2.1, mkdirp@0.3.5, tmp@0.0.33, sudo-block@0.2.1, request-progress@0.3.1, bower-json@0.4.0, glob@3.2.11, fstream-ignore@0.0.10, tar@0.1.20, promptly@0.2.1, fstream@0.1.31, cardinal@0.4.4, request@2.27.0, decompress-zip@0.0.8, handlebars@1.0.12, inquirer@0.3.5, mout@0.7.1, bower-config@0.5.3, update-notifier@0.1.10, bower-registry-client@0.1.6)
grunt-contrib-imagemin@0.4.1 node_modules/grunt-contrib-imagemin
├── filesize@2.0.4
├── async@0.2.10
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── pngquant-bin@0.1.7 (bin-wrapper@0.2.4)
├── optipng-bin@0.3.11 (log-symbols@1.0.2, bin-wrapper@0.3.4, bin-build@0.1.1)
├── jpegtran-bin@0.2.8 (log-symbols@1.0.2, bin-wrapper@0.3.4, bin-build@0.1.1)
└── gifsicle@0.1.7 (log-symbols@1.0.2, bin-wrapper@0.3.4, bin-build@0.1.1)
karma-script-launcher@0.1.0 node_modules/karma-script-launcher
karma-firefox-launcher@0.1.7 node_modules/karma-firefox-launcher
karma-html2js-preprocessor@0.1.0 node_modules/karma-html2js-preprocessor
karma-chrome-launcher@0.1.12 node_modules/karma-chrome-launcher
└── which@1.3.0 (isexe@2.0.0)
karma-coffee-preprocessor@0.1.3 node_modules/karma-coffee-preprocessor
└── coffee-script@1.7.1 (mkdirp@0.3.5)
requirejs@2.3.5 node_modules/requirejs
karma-requirejs@0.2.6 node_modules/karma-requirejs
karma-phantomjs-launcher@0.1.4 node_modules/karma-phantomjs-launcher
└── phantomjs@1.9.20 (progress@1.1.8, kew@0.7.0, which@1.2.14, request-progress@2.0.1, hasha@2.2.0, extract-zip@1.5.0, fs-extra@0.26.7, request@2.67.0)
karma@0.10.10 node_modules/karma
├── colors@0.6.0-1
├── di@0.0.1
├── graceful-fs@1.2.3
├── mime@1.2.11
├── rimraf@2.1.4
├── q@0.9.7
├── lodash@1.1.1
├── coffee-script@1.6.3
├── minimatch@0.2.14 (sigmund@1.0.1, lru-cache@2.7.3)
├── glob@3.1.21 (inherits@1.0.2)
├── optimist@0.3.7 (wordwrap@0.0.3)
├── useragent@2.0.10 (lru-cache@2.2.4)
├── log4js@0.6.38 (semver@4.3.6, readable-stream@1.0.34)
├── chokidar@0.8.4 (recursive-readdir@0.0.2)
├── connect@2.8.8 (methods@0.0.1, uid2@0.0.2, qs@0.6.5, cookie-signature@1.0.1, pause@0.0.1, buffer-crc32@0.2.1, bytes@0.2.0, fresh@0.2.0, cookie@0.1.0, send@0.1.4, debug@3.1.0, formidable@1.0.14)
├── http-proxy@0.10.4 (colors@0.6.2, pkginfo@0.3.1, optimist@0.6.1, utile@0.2.1)
└── socket.io@0.9.19 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)
解决方法是n先安装打字
npm install -g n
然后用
安装sudo n 4.4.3
此安装将设置您的节点 js 版本以在系统中使用