Could not find a package.json file. Run 'npm init' to create one. Error: Could not find a package.json file. Run 'npm init' to create one. at check (/Users/sdhaksh5/.nvm/versions/node/v10.16.0/lib/node_modules/eslint/lib/init/npm-utils.js:106:15) at Object.checkDevDeps (/Users/sdhaksh5/.nvm/versions/node/v10.16.0/lib/node_modules/eslint/lib/init/npm-utils.js:160:12) at getModulesList (/Users/sdhaksh5/.nvm/versions/node/v10.16.0/lib/node_modules/eslint/lib/init/config-initializer.js:126:40) at inquirer.prompt.then.earlyAnswers (/Users/sdhaksh5/.nvm/versions/node/v10.16.0/lib/node_modules/eslint/lib/init/config-initializer.js:547:29) at process._tickCallback (internal/process/next_tick.js:68:7)
- Run the command in the browser / node.
- Usage of any package management modules. (npm )
- React of Vue.js project
The cli is what you use to run eslint. but any command that you invoke from it requires the eslint libraries. So i installed the eslint libraries using npm install -g eslint, so that it's available to run it from any packages. And after this create an empty package.json in the current folder and add the following
This is to make sure that we don't have any packages. Now run eslint --init, it should run without issues.
I originally did this to make eslint work with vim so that i can develop my chrome extension that will be used to fix a missing feature in Bamboo to download artifacts from a completed build, which is inturn used to run the artifacts (.NET Fx) with fortify in Mac because you cannot build the .NET Fx binaries in Mac, which is inturn done because of fortify installation fails in windows 10 (x64) and a fix to this is void by our security team :-(
Never give up because your security team doesn't give a what !