Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.swp
npm-debug.log
.nyc_output/
/node_modules/.cache
/test/bin
/test/output.log
/test/*/*/node_modules
Expand Down
4 changes: 2 additions & 2 deletions lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
npm.command = c
if (commandCache[a]) return commandCache[a]

var cmd = require(path.join(__dirname, a + '.js'))
var cmd = require('./' + a + '.js')

commandCache[a] = function () {
var args = Array.prototype.slice.call(arguments, 0)
Expand Down Expand Up @@ -235,7 +235,7 @@
onload = onload && npm.config.get('onload-script')
if (onload) {
try {
require(onload)
(new Function(`require(${onload})`))() // eslint-disable-line
} catch (err) {
log.warn('onload-script', 'failed to require onload script', onload)
log.warn('onload-script', err)
Expand Down
Loading