How to include the path for the node binary npm was executed with

后端 未结 4 955
天命终不由人
天命终不由人 2021-01-30 03:06

Windows, VSC, Running npm start got this

npm WARN lifecycle The node binary used for scripts is C:\\Program Files\\nodejs\\node.exe but npm

4条回答
  •  伪装坚强ぢ
    2021-01-30 03:37

    Conflict between your node binary and your npm


    In case the error looks something like:

    npm is trying to use the same node as the one it use to run itself.

    resolve this conflict by adding the node directory to your PATH:

    npm config set scripts-prepend-node-path true
    

    From the npm documentation:

    npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is passed, the directory within which node resides is added to the PATH

提交回复
热议问题