Romain Blt Romain Blt - 4 months ago 67x
Node.js Question

npm ERR! at start.cmd Path must be a string - Node

I can't figure why my start npm script cmd display this error on my Mac :

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! 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

It works great on PC... The command script is

SET html=../../com.view.html&& npm start

I have the same error when running npm start


I think you must use the export command instead of set to set an environment variable on an Unix system.