nodejs と npm を使用してアプリケーションを開発しています。私は Windows 10 を使用しており、npm v.3.3.7 とノード v.4.1.2 を使用しています。
それらを設定するには、次の手順を実行します。
- npm で NodeJs をインストールする
- git から Npm-master 3.3.7 をダウンロードし、フォルダー C:\Program Files\nodejs\node_modules\npm を上書きします。
- 環境変数に追加 C:\Users\bilias7\AppData\Roaming\npm;C:\Program Files\nodejs; 現在のユーザーおよびシステム PATH 変数用。
ここまですべてが機能するまで、CMDからノードとnpmの両方を使用でき、昇格したCMDでグローバルパッケージをインストールできます。
node-sass に依存する gulp-sass をインストールしようとすると、問題が発生します。以下のコマンドは、node が内部コマンドまたは外部コマンドとして認識されないというエラーを返します。
npm install -g gulp-sass
以下のエラーでわかるように、node-sass パッケージのインストールによって返されたエラーです。
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN install:node-sass@3.3.3 node-sass@3.3.3 install: `node scripts/install.js`
npm WARN install:node-sass@3.3.3 Exit status 1
C:\Program Files\nodejs
└── (empty)
npm ERR! code 1
そこで、次のコマンドを使用して node-sass を明示的にインストールしようとしました
npm install -g node-sass
そして、次のような詳細なエラーが発生しました。install.jsの実行中に何か問題が発生し、コマンドノードに接続されていないと思いますが、それが何であるかわかりません。
C:\Program Files\nodejs\node-sass -> C:\Program Files\nodejs\node_modules\node-sass\bin\node-sass
> node-sass@3.3.3 install C:\Program Files\nodejs\node_modules\node-sass
> node scripts/install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "node-sass"
npm ERR! node v4.1.2
npm ERR! npm v3.3.7
npm ERR! code ELIFECYCLE
npm ERR! node-sass@3.3.3 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.3.3 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
また、ここから完全なログ ファイルをダウンロードできます。
私はすでに20時間以上費やしているので、どんなアイデアでも役に立ち、歓迎します!!