Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

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

Closed
Jud opened this issue Nov 12, 2020 · 0 comments
Closed

Comments

@Jud
Copy link
Contributor

Jud commented Nov 12, 2020

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"
  }
}
danielleadams pushed a commit that referenced this issue Dec 7, 2020
* [#43] Ensure $layer_dir exists before installing npm

* Add PR to CHANGELOG

* Add npm behavior to mock, fixup lint issue

* Fixup errant space in 'npm root' mock

* Add file_present/file_absent tests
@Jud Jud closed this as completed Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant