npm uninstall
почистит node_modules
, package.json
, package-lock.json
node_modules
, удалит файлы зависимостей, и их снова можно будет установить через npm install
(если остался package.json
)
The key that identifies the JS script file. If null, it will use $url as the key. If two JS files are registered with the same key at the same position, the latter will overwrite the former. Note that position option takes precedence, thus files registered with the same key, but different position option will not override each other.
.
├── index.js
├── package.json
└── sub
├── a.js
└── b.js
console.log('module a');
module.exports = module;
console.log('module b');
const moduleA = require('./sub/a.js');
moduleA.require('./b.js');
require('./b.js');
$ node index.js
module a
module b
module.js:515
throw err;
^
Error: Cannot find module './b.js'
at Function.Module._resolveFilename (module.js:513:15)
at Function.Module._load (module.js:463:25)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/anton/projects/node/require-test/index.js:3:1)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
box-sizing: border-box;
new webpack.DefinePlugin({
'ENV_API_ROOT_V1': JSON.stringify(process.env.ENV_API_ROOT_V1),
'HTTP_PROTOCOL': JSON.stringify(process.env.HTTP_PROTOCOL),
'WS_PROTOCOL': JSON.stringify(process.env.WS_PROTOCOL),
}),
cross-env ENV_API_ROOT_V1=my_url_for_Api.com HTTP_PROTOCOL=https WS_PROTOCOL=wss webpack --progress --config ./webpack.prod.config.js
Returns a string of up to length - 1 bytes read from the file pointed