heroku / nodejs-npm-buildpack

Heroku Cloud Native Buildpack for NPM on Node.js runtime
6 stars 7 forks source link

ENOENT: no such file or directory, lstat '/layers/heroku_nodejs-npm/npm' #43

Closed Jud closed 3 years ago

Jud commented 4 years ago

Testing heroku/buildpacks:18 with a nodejs project and getting an error when the npm version is specified in package.json. The build succeeds if the npm version is removed from package.json.

Running pack build -v --builder=heroku/buildpacks:18 example-app outputs:

[...snip...]
===> BUILDING
---> Node.js Buildpack
---> Setting NODE_ENV to production
---> Installing toolbox
---> Getting Node version
---> Resolving Node version
---> Downloading and extracting Node v15.2.0
---> Parsing package.json
---> No file to start server
---> either use 'docker run' to start container or add index.js or server.js
npm notice
npm notice New patch version of npm available! 7.0.8 -> 7.0.10
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.10>
npm notice Run `npm install -g npm@7.0.10` to update!
npm notice
---> Installing npm v6.x from package.json
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /layers/heroku_nodejs-npm/npm
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/layers/heroku_nodejs-npm/npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Here is a minimal package.json to reproduce the issue.

{
  "name": "example-app",
  "version": "1",
  "engines": {
    "node": "15.x",
    "npm": "6.x"
  },
  "dependencies": {
    "chai": "^4.2.0",
    "dotenv": "^8.2.0"
  }
}