Error finding npm path
Opened this issue · 1 comments
sibelius commented
Using your command:
find / -name npm | tail -1 | xargs -I % sh -c "dirname %"
you find the path: /app/.heroku/node/lib/node_modules/npm/bin/, instead of /app/.heroku/node/bin/
you should change to:
find / -name npm | head -1 | xargs -I % sh -c "dirname %"
arnthorsnaer commented
I had the same result with "find .... tail" but me (and perhaps you) are testing the "find ..." command on a container after "git push" process.
I changed it to "find ... head" and tried echoing the $new_path variable but it is empty.
It seems to me that at the stage of the build where this code is executed the "/app/.heroku/node...." folder has not been created and this causes the error finding the npm path.
I believe I have validated this and swapping out the "find ..." for the "/app/...." and then everything works as expected.
Hope this makes sense.