1
我試圖將我的Phoenix應用程序推送到Heroku時出現此錯誤。如何修復「npm ERROR!addLocal無法安裝」
我一直在關注guide from the Phoenix framework website。
什麼是導致此錯誤,我該如何解決它?
WARNING: phoenix_static_buildpack.config wasn't found in the app
remote: Using default config from Phoenix static buildpack
remote: Will use the following versions:
remote: * Node 6.9.2
remote: Will export the following config vars:
remote: * Config vars DATABASE_URL
remote: * MIX_ENV=prod
remote:
remote: -----> Installing binaries
remote: Downloading node 6.9.2...
remote: Installing Node 6.9.2...
remote: Using default npm version
remote:
remote: -----> Building dependencies
remote: Installing and caching node modules
remote: npm ERR! addLocal Could not install /tmp/build_23f60aac277eab15b4ce274dcaf9bb16/deps/phoenix
remote: npm ERR! addLocal Could not install /tmp/build_23f60aac277eab15b4ce274dcaf9bb16/deps/phoenix_html
remote: npm ERR! Linux 3.13.0-105-generic
remote: npm ERR! argv "/tmp/build_23f60aac277eab15b4ce274dcaf9bb16/.heroku/node/bin/node" "/tmp/build_23f60aac277eab15b4ce274dcaf9bb16/.heroku/node/bin/npm" "install" "--quiet" "--unsafe-perm" "--userconfig" "/tmp/build_23f60aac277eab15b4ce274dcaf9bb16/npmrc"
remote: npm ERR! node v6.9.2
remote: npm ERR! npm v3.10.9
remote: npm ERR! path /tmp/build_23f60aac277eab15b4ce274dcaf9bb16/deps/phoenix
remote: npm ERR! code ENOENT
remote: npm ERR! errno -2
remote: npm ERR! syscall open
remote:
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_23f60aac277eab15b4ce274dcaf9bb16/deps/phoenix'
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_23f60aac277eab15b4ce274dcaf9bb16/deps/phoenix'
remote: npm ERR! enoent This is most likely not a problem with npm itself
remote: npm ERR! enoent and is related to npm not being able to find a file.
remote: npm ERR! enoent
remote:
remote: npm ERR! Please include the following file with any support request:
remote: npm ERR! /tmp/build_23f60aac277eab15b4ce274dcaf9bb16/npm-debug.log
remote: ! Push rejected, failed to compile Phoenix app.
從輸出看來,您的節點已更新,並且npm不是。也許手動更新npm?在這裏找到可能的解決方案:https://github.com/npm/npm/issues/10165#issuecomment-152451743 – Migore
我試過這個(發現線程之前問這個問題),它並沒有幫助。謝謝你的想法。 –
你嘗試過使用sudo嗎? – PatNowak