- Do you want to request a _feature_ or report a _bug_?
Bug
- What is the current behavior?
Running command netlify deploy showing Error: Cannot find module 'npm-normalize-package-bin'. Previously it working just fine, then i thought it must be about versioning (Deploy happen in circleci, so we always install the netlify-cli to the most update). But after trying deploy it locally with downgraded version, it still showing the same error.
- If the current behavior is a bug, please provide the steps to reproduce.
Run netlify deploy
- What is the expected behavior?
Site successfully deployed.
- Local Environment Information
Error: Cannot find module 'npm-normalize-package-bin'
at Object.<anonymous> (~/Kodefox/insight/frontend/node_modules/npm-packlist/index.js:20:29)
Interesting.
What is using the npm-normalize-package-bin the CLI doesn't appear to be using this dep. package-lock
Is your frontend code using this module? Or perhaps a netlify function in your project?
Interesting.
What is using the
npm-normalize-package-binthe CLI doesn't appear to be using this dep. package-lockIs your frontend code using this module? Or perhaps a netlify function in your project?
My code doesn't use the module, nor a netlify function in my project. It appears after checking my node_modules on folder npm-packlistwith netlify-cli installed and not, there is one line added in index.js everytime netlify-cli is installed.
--> const normalizePackageBin = require('npm-normalize-package-bin')
I don't know if this connected but is this because npm-packlist latest commit? https://github.com/npm/npm-packlist/commit/196df5ceaa55f63a9a36aaafb98e9e37cce4e423
Having the same issue now. I traced it to npm-normalize-package-bin which is now npm-normalize-package-data. For now downgrading is the only option.
Not even downgrading appears to make this work, I rolled back to 2.21.0 and still the same issue with a fresh install of the global CLI. So my guess would be this means any new CLI users will have the same issue.
This same error happened to me in an older create-react-app totally unrelated to the CLI today. Very strange.
Can you remove your project package-lock.json / yarn.lock file and try to install the CLI again?
If that still doesn't work rm -rf node_modules in your project directory and do a fresh install of everything.
After removing locks/modules npm install netlify-cli -g
Can confirm deleting the global yarn.lock file resolved the issue.
Most helpful comment
Can confirm deleting the global
yarn.lockfile resolved the issue.