我无法理解为什么我的开始npm脚本cmd在我的Mac上显示此错误:
path.js:8
throw new TypeError('Path must be a string. Received ' +
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.join (path.js:479:5)
at Object.<anonymous> (/Users/romain/Desktop/Sources/com.controller.nodejs/central/app.js:16:23)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/romain/Desktop/Sources/com.controller.nodejs/central/bin/www:7:11)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.4.1
npm ERR! npm v3.9.6
npm ERR! code ELIFECYCLE
npm ERR! central@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the central@0.0.0 start script 'node ./bin/www'.
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 central package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
它在PC上运行良好...命令脚本是
SET html=../../com.view.html&& npm start
运行npm start时出现相同的错误
答案 0 :(得分:0)
我认为你必须使用export
命令代替set
在Unix系统上设置环境变量。