package-lock.json is not generated when using `npm i` (npm v6.3.0, node v8.9.2)

Viewed 86

For some of my projects, I don't know why, the package-lock.json file is not being generated by npm i, nor npm install --package-lock nor anything I could try...

I also tried to rm -rf node-modules && npm i, same result.

I read all the related questions I could find here or on the internet, but none of them could help in my current context:

  • I do have a .npmrc, but it only contains this single character: '8' (requiring version 8 of node)

  • npm -v returns 6.3.0

  • node -v returns v8.9.2

1 Answers

Try npm config list

The global setting package-lock=false indicates that package lock will not get generated.

Try npm config set package-lock true OR npm install --package-lock

Hope this helps

Related