Search code examples
javascriptnode.jsnpmes6-promise

Installing es6-promise


I am working through the nodeschool.io workshops and the second exercise of promise-it-wont-hurt is instructing me to install es6-promise.

Using my Windows 7 command prompt, I am typing npm install es6-promise (and some other variations) and I am getting the message.

npm ERR! code E404
npm ERR! 404 Not Found: es6-promise@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\...\_logs\2018-12-21T03_29_29_521Z-debug.log

I've just cleared my dependencies and my other node_modules from a past project so maybe I need have some other packaged installed to get this one.

Edit:

Here's the extended debug log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\node\\node.exe',
1 verbose cli   'C:\\Users\\Jonathan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'es6-promise' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session e293531fca9c2053
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 http://localhost:15443/es6-promise 28ms
8 silly fetchPackageMetaData error for es6-promise@latest 404 Not Found: es6-promise@latest
9 timing stage:rollbackFailedOptional Completed in 0ms
10 timing stage:runTopLevelLifecycles Completed in 206ms
11 verbose stack Error: 404 Not Found: es6-promise@latest
11 verbose stack     at fetch.then.res (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
11 verbose stack     at tryCatcher (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
11 verbose stack     at Promise._settlePromiseFromHandler (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
11 verbose stack     at Promise._settlePromise (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
11 verbose stack     at Promise._settlePromise0 (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
11 verbose stack     at Promise._settlePromises (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:694:18)
11 verbose stack     at _drainQueueStep (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:138:12)
11 verbose stack     at _drainQueue (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
11 verbose stack     at Async._drainQueues (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
11 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
11 verbose stack     at runCallback (timers.js:705:18)
11 verbose stack     at tryOnImmediate (timers.js:676:5)
11 verbose stack     at processImmediate (timers.js:658:5)
12 verbose cwd C:\Users\Jonathan\Desktop\nodecrap
13 verbose Windows_NT 6.1.7601
14 verbose argv "C:\\node\\node.exe" "C:\\Users\\Jonathan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "es6-promise"
15 verbose node v10.14.2
16 verbose npm  v6.5.0
17 error code E404
18 error 404 Not Found: es6-promise@latest
19 verbose exit [ 1, true ]

Solution

  • It seems have configured a custom npm mirror, supposedly running at http://localhost:15443/ . This mirror does not have es6-promise, for whatever reason.

    You can reset this to the normal npm by running

    npm set registry https://registry.npmjs.org/
    

    After this, you could install es6-promise by running npm install es6-promise again. This may be necessary for your tutorial.

    However, in general, promises (and async/await) are already available out of the box in your node version, without having to install anything.