2017-10-16 29 views
-1

私はnode.js v8.6.0をインストールしており、v.4.4.3のnpmモジュールを開発しようとしています。同じオペレーティングシステムで異なるバージョンのnode.jsを管理するにはどうすればよいですか?

$ 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 [email protected]: use grunt-ng-annotate instead 
npm WARN deprecated [email protected]: ...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 [email protected]: connect 2.x series is deprecated 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: use ng-annotate instead 
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 
npm WARN deprecated [email protected]: connect 2.x series is deprecated 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: Use uuid module instead 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: Use the globby package instead 

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

> [email protected] 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: [email protected]:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138 (node_modules/chokidar/node_modules/fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 
npm WARN [email protected] requires a peer of [email protected]~0.2.0 but none is installed. You must install peer dependencies yourself. 
npm WARN [email protected] requires a peer of [email protected]~0.1.0 but none is installed. You must install peer dependencies yourself. 
npm WARN [email protected] requires a peer of [email protected]~0.1.0 but none is installed. You must install peer dependencies yourself. 
npm WARN [email protected] requires a peer of [email protected]~0.1.0 but none is installed. You must install peer dependencies yourself. 
npm WARN [email protected] requires a peer of [email protected]~0.1.0 but none is installed. You must install peer dependencies yourself. 
npm WARN [email protected] requires a peer of [email protected]~0.1.0 but none is installed. You must install peer dependencies yourself. 
npm WARN ka[email protected] requires a peer of [email protected]~0.1.0 but none is installed. You must install peer dependencies yourself. 
npm WARN [email protected] No repository field. 
npm WARN [email protected] No license field. 

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

私はアプリケーションを実行できません。この問題を解決するのに手伝ってもらえますか?

+1

システムで使用するようにノードjsのバージョンを設定します

npm install -g n 

を入力してインストールしてから、これはインストール

sudo n 4.4.3 

とインストールノードの最新バージョンをインストールします。 – SLaks

+0

node.js @SLaksのバージョン –

+0

GustavoMuñozValenzuelaがそれをより良く策定したので、私の解決策を削除しましたが、それはあなたのために行く方法です。 –

答えて

1

ソリューションはnである第一あなたがすべき

0

「パスは文字列でなければなりません」と表示され、受信したpathは文字列ではなくオブジェクトです。

おそらくpathの代わりにpath.urlを使用する必要がありますか?

(ちょうどあなたが質問のこれらのタイプを尋ねるときは、関連するコードを表示する必要があります。推測。)

+0

お返事ありがとうございますが、この解決策は私の問題を解決していない@cybersam –

0

私はNVM(ノードバージョンマネージャ)の問題インストールを解決し、V4.4.3は

1をNode.jsの)nvmをインストールするには

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 [email protected] No repository field. 
npm WARN package.json [email protected] No README data 
npm WARN package.json [email protected] No license field. 
npm WARN deprecated [email protected]: use grunt-ng-annotate instead 
npm WARN engine [email protected]: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN deprecated [email protected]: use ng-annotate instead 
npm WARN deprecated [email protected]: ...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 [email protected]: connect 2.x series is deprecated 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN peerDependencies The peer dependency [email protected]~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 [email protected]~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 [email protected]~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 [email protected]~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 [email protected]~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 [email protected]~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 [email protected]~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 [email protected]: connect 2.x series is deprecated 
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 
npm WARN deprecated [email protected]: Use the globby package instead 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 

> [email protected] postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-autoprefixer 
> 

npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"4.4.3","npm":"2.15.1"}) 
npm WARN optional dep failed, continuing [email protected] 
npm WARN deprecated [email protected]: Use uuid module instead 

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

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

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

> [email protected] postinstall /home/limitless/Documents/projects/test/scala/myapp/node_modules/grunt-contrib-imagemin/node_modules/gifsicle 
> node index.js 

✔ pre-build test passed successfully! 

> [email protected] 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 [email protected]^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 [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130 
/
> [email protected] 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 
[email protected] node_modules/karma-jasmine 

[email protected] node_modules/grunt-rev 

[email protected] node_modules/karma-ng-scenario 

[email protected] node_modules/grunt-contrib-concat 

[email protected] node_modules/grunt-contrib-copy 

[email protected] node_modules/karma-junit-reporter 
└── [email protected] 

[email protected] node_modules/grunt-contrib-clean 
└── [email protected] 

[email protected] node_modules/grunt-sync 
└── [email protected] 

[email protected] node_modules/grunt-concurrent 
├── [email protected] 
└── [email protected] 

[email protected] node_modules/time-grunt 
├── [email protected] 
├── [email protected] 
├── [email protected] 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-htmlmin 
├── [email protected] 
└── [email protected] ([email protected]) 

[email protected] node_modules/grunt-connect-proxy 
├── [email protected] 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-cssmin 
├── [email protected] ([email protected]) 
└── [email protected] ([email protected]) 

[email protected] node_modules/grunt-karma 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-usemin 
├── [email protected] 
└── [email protected] 

[email protected] node_modules/load-grunt-tasks 
├── [email protected] ([email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-svgmin 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-autoprefixer 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-connect 
├── [email protected] 
├── [email protected] 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-watch 
├── [email protected] ([email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-bower-install 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-uglify 
├── [email protected] ([email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-ngmin 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-jshint 
└── [email protected] ([email protected], [email protected], [email protected], she[email protected], [email protected]) 

[email protected] node_modules/grunt 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected]) 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
└── [email protected] ([email protected], [email protected]) 

[email protected] node_modules/grunt-modernizr 
├── [email protected] 
├── [email protected] 
├── [email protected] 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-bowercopy 
├── [email protected] 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], p-[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/grunt-contrib-imagemin 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected]) 

[email protected] node_modules/karma-script-launcher 

[email protected] node_modules/karma-firefox-launcher 

[email protected] node_modules/karma-html2js-preprocessor 

[email protected] node_modules/karma-chrome-launcher 
└── [email protected] ([email protected]) 

[email protected] node_modules/karma-coffee-preprocessor 
└── [email protected] ([email protected]) 

[email protected] node_modules/requirejs 

[email protected] node_modules/karma-requirejs 

[email protected] node_modules/karma-phantomjs-launcher 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] node_modules/karma 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
関連する問題