vendredi 27 mars 2015

npm publish fails due to ENOENT due to npm being out of sync with environment path. Windows 8.1 x64

I receive the following error when issueing the following command



npm publish


This is the error I receive:



> npm run build

npm ERR! addLocalDirectory Could not pack C:\Users\User\Documents\GitHub\material-redo\material-ui to C:\Users\User\AppData\Roaming\npm-cache\material-ui\0.7.2\package.tgz
npm ERR! addLocal Could not install C:\Users\User\Documents\GitHub\material-redo\material-ui
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "publish"
npm ERR! node v0.12.1
npm ERR! npm v2.7.4
npm ERR! file C:\WINDOWS\system32\cmd.exe;C:\Python34
npm ERR! path C:\WINDOWS\system32\cmd.exe;C:\Python34
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\WINDOWS\system32\cmd.exe;C:\Python34
npm ERR! material-ui@0.7.2 prepublish: `npm run build`
npm ERR! spawn C:\WINDOWS\system32\cmd.exe;C:\Python34 ENOENT
npm ERR!
npm ERR! Failed at the material-ui@0.7.2 prepublish script 'npm run build'.
npm ERR! This is most likely a problem with the material-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get their info via:
npm ERR! npm owner ls material-ui
npm ERR! There is likely additional logging output above.
npm ERR! addLocalDirectory Could not pack C:\Users\User\Documents\GitHub\material-redo\material-ui to C:\Users\User\AppData\Roaming\npm-cache\material-ui\0.7.2\package.tgz
npm ERR! addLocal Could not install C:\Users\User\Documents\GitHub\material-redo\material-ui
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "publish"
npm ERR! node v0.12.1
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE


Here is the npm run build script in my package.json the error is refering too:



"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prebuild": "rm -rf lib",
"build:js": "./node_modules/.bin/jsx --harmony ./src ./lib",
"build:jsx": "./node_modules/.bin/jsx --harmony -x jsx ./src ./lib",
"build": "npm run build:js && npm run build:jsx",
"prepublish": "npm run build"
},


I've re-installed npm and node to their latest versions. I believe the cause of this issue is my version of Python as indicated here. I reverted back to Python 2.7 as instructed here, issueing the following command:


npm config set python C:\Python27


However it seems like npm is still referencing C:\Python34, which has been deleted. I believe npm is not using my updated path environment:



C:\Program Files (x86)\ConEmu;C:\Program Files (x86)\ConEmu\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\NetSarang;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\MATLAB\R2013a\runtime\win64;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.6\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\nodejs\;C:\Program Files\MongoDB 2.6 Standard\bin\;C:\Users\User\AppData\Roaming\npm


Is my assumption correct? If so, how can this be fixed? Thank you in advanced.


Aucun commentaire:

Enregistrer un commentaire