Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

npm install failure, tsc not found #424

Closed
ghost opened this issue Nov 15, 2016 · 8 comments
Closed

npm install failure, tsc not found #424

ghost opened this issue Nov 15, 2016 · 8 comments

Comments

@ghost
Copy link

ghost commented Nov 15, 2016

We run js-ipfs-api tests as part of go-ipfs CI, and started getting this failure today or very recently: http://ci.ipfs.team:8111/viewLog.html?buildId=7909&buildTypeId=GoIpfs_JsIpfsApiTests&tab=buildLog#_focus=771

[22:25:05][Step 2/3] > webcrypto-core@0.1.2 build:es5 /teamcity/work/3144e2a06f62fd48/js-ipfs-api/node_modules/webcrypto-core
[22:25:05][Step 2/3] > tsc --module commonjs --target es5
[22:25:05][Step 2/3] 
[22:25:05][Step 2/3] sh: 1: tsc: not found
@victorb
Copy link
Contributor

victorb commented Nov 15, 2016

Took a quick look at this. Seems webcrypto-core is trying to use a Typescript compiler on install, which is not installed with the module. But, more worrying, I can't even see where webcrypto-core is coming from, it's not listed in our package.json and I only see (empty) when doing npm ls webcrypto-core on current master.

➜  js-ipfs-api git:(master) npm ls webcrypto-core
ipfs-api@11.1.0 /home/victor/projects/ipfs/js-ipfs-api
└── (empty)

Makes me think that maybe js-ipfs-api-tests are running an old version of js-ipfs-api or something is screwed with the cache. Otherwise, maybe @dignifiedquire have an idea, since this seems related with the crypto stuff.

@victorb
Copy link
Contributor

victorb commented Nov 15, 2016

Hah, apparently npm ls only lists already installed modules instead of what modules would be installed... Installing modules with dry-run tells us which module this comes from:

ipfs-api@11.1.0 /home/victor/projects/ipfs/js-ipfs-api
├─┬ peer-id@0.8.0 
│ └─┬ libp2p-crypto@0.7.1 
│   └─┬ node-webcrypto-ossl@1.0.10 
│     └── webcrypto-core@0.1.2  (git+https://github.com/PeculiarVentures/webcrypto-core.git#cb7b6c66030a41e4ff53e9137391efead37b09b2)
└── peer-info@0.8.0 

@victorb
Copy link
Contributor

victorb commented Nov 15, 2016

Ok, now I figured out the problem and a fix. TLDR: We need to merge libp2p/js-libp2p-crypto#34 to update node-webcrypto-ossl whose install was broken for people who don't have Typescript globally installed cc @diasdavid @dignifiedquire

Long story: webcrypto-core had an issue where unless you have the Typescript compiler installed globally, install failed. The version of node-webcrypto-ossl that we use in libp2p-crypto was locked to commit cb7b6c66030a41e4ff53e9137391efead37b09b2 of webcrypto-core where this issue exists. Author have pushed an update to fix this (version 1.0.10 and issue to track here: PeculiarVentures/node-webcrypto-ossl#75) which we got an PR from greenkeeper to merge (as seen here: libp2p/js-libp2p-crypto#34). However, it's breaking the build so some more work is required.

@victorb
Copy link
Contributor

victorb commented Nov 15, 2016

Also, came across this from mediachain where they hit the same issue mediachain/aleph#79

@dignifiedquire
Copy link
Contributor

Restarted CI on the libp2p-crypto PR, going to merge and ship as soon as this actually works again on CI

@dignifiedquire
Copy link
Contributor

Should be fixed now, please try again with a fresh cache

@victorb
Copy link
Contributor

victorb commented Nov 16, 2016

@lgierth I rerun the test you linked before and install is now successful! http://ci.ipfs.team:8111/viewLog.html?buildId=7994&buildTypeId=GoIpfs_JsIpfsApiTests&tab=buildLog#_focus=748

@victorb victorb closed this as completed Nov 16, 2016
@daviddias
Copy link
Contributor

<3 thank you all <3 it felt really awesome to see a problem being reported, fixed and released involving so many people and happening so fast! :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants