2017-08-23 7 views
0

拡張機能をインストールするときに、ブラケット拡張マネージャーでスクリプトを実行します。大括弧内のスクリプトを実行するにはpackage.json?

このコードは、括弧内のデフォルトの拡張子 'JavaScriptCodeHints'で見つかりました。

{ 
    "name": "brackets-javascript-code-hints", 
    "dependencies": { 
    "acorn": "3.3.0", 
    "tern": "0.20.0" 
}, 
    "scripts": { 
    "postinstall": "node ./fix-acorn" 
    } 
} 

"postinstall": "node ./test"を使用した場合と同じですが、このエラーメッセージが表示されました。

npm-stderr: sh: node: command not found 

npm WARN [email protected] No description 
npm WARN [email protected] No repository field. 
npm WARN [email protected] No license field. 
npm ERR! Darwin 16.7.0 
npm ERR! argv "/Applications/Brackets.app/Contents/MacOS/Brackets-node" "/Applications/Brackets.app/Contents/www/node_modules/npm/bin/npm-cli.js" "install" "--production" 
npm ERR! node v6.3.1 
npm ERR! npm v3.10.9 
npm ERR! file sh 
npm ERR! code ELIFECYCLE 
npm ERR! errno ENOENT 
npm ERR! syscall spawn 
npm ERR! [email protected] postinstall: `node ./test` 
npm ERR! spawn ENOENT 
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'node ./test'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the testExtensionInstaller package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node ./test 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs testExtensionInstaller 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls testExtensionInstaller 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /private/var/folders/1y/bd63w8h51wzccq_zbw6804440000gn/T/bracketsPackage_117723-46419-zgk6x5.ki3sicc8fr/testExtensionInstaller/npm-debug.log 

ブラケット拡張インストールでノードnode1をインストールしないでどのように使用しますか?

答えて

0

これはブラケットとは何の関係もありません、あなたはあなたがあなたのPATH環境変数にnodeJSに(C:\Program Files\nodejs)のようなものをインストール場所を追加する必要があるノード

が含まれるようにファイルシステムのパスを更新する必要があります。これを行うには次の手順を実行します。

  1. を「環境変数」
  2. クリックして「編集システム環境変数」ダイアログで
  3. クリックして「環境変数」を検索するグローバル検索チャームを使用してください。
  4. [システム変数]ボックスで、[パス]を検索し、C:\Program Files\nodejsを含めるように編集します。 ;で他のパスから区切られていることを確認してください。

有効にするには、現在開いているコマンドプロンプトを再起動する必要があります。

+0

私はそうです。デフォルトの拡張機能はnodejsとPATH環境なしでインストールされています。 – Amadas

+0

'console.log(process.env.PATH);' – Bamieh

+0

という拡張子を使って次のファイルを実行すると、ノードのパスがbrackets-nodejsの実行時環境にあるかどうか確認してください。だから私はブラケットを構築するまでコードを追加することはできません。 https://github.com/adobe/brackets/tree/master/src/extensions/default/JavaScriptCodeHintsはデフォルトの拡張ですgithub url – Amadas

関連する問題