Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Problem with lib/post_install.js and gulp? #27

Open
philandy opened this issue Feb 21, 2018 · 3 comments
Open

Problem with lib/post_install.js and gulp? #27

philandy opened this issue Feb 21, 2018 · 3 comments

Comments

@philandy
Copy link

> node lib/post_install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"android","arch":"arm"})

added 976 packages in 178.255s

Congrats! Now, launch your project using
npm start and happy hacking :)
$ npm start

> @ start /data/data/com.termux/files/.../testproject2
> gulp

sh: 1: gulp: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ start: `gulp`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2018-02-21T07_23_40_153Z-debug.log

Tried a yarn add gulp

success Saved 689 new dependencies.
...
├─ [email protected]
├─ [email protected]
├─ [email protected]

Yet still getting gulp not found?

Also having trouble with fsevents so that might explain some of it. Thanks! So close though.

@rblopes
Copy link
Owner

rblopes commented Feb 21, 2018

It looks like you're using Termux, an dev environment I'm not familiar with. I may not be able to provide a suitable solution for your issue, but I'll try it anyway.

In general, the warnings you see after the installation should go away running npm dedupe. fsevents, as is said in the messages, is required only on MacOS, so it shouldn't be a problem.

The sample projects are using Gulp 4, not 3. It shouldn't be necessary, however in case you have overridden the default installation, install Gulp 4 again with npm install gulp@next. Also, gulp-cli may be a good addition, so install it globally.

Now for the part I'm not sure I can help much. For some reason, npm seems to be not adding your project to its own PATH. To check that, add a little test script to your project package.json with the following command:

{
  "scripts": {
    "path": "echo $PATH | tr ':' '\n'"
  },
}

It should print a path with .../<my-project>/node_modules/.bin in normal situations, meaning it can find the .bin directory of your node_modules and use the scripts copied (linked) there. A fallback could be to change all scripts to ./node_modules/.bin/gulp .... It could be a permission issue too, I'm not sure.

@philandy
Copy link
Author

I'm probably doing NPM wrong then, wow. Sorry. I tried npm install gulp@next and now my CWD has a new directory in it; was assuming npm would update to it's own home directory of its choosing. How would I roll that back to undo that change?

@rblopes
Copy link
Owner

rblopes commented Feb 22, 2018

Do you mean that that new dir is node_modules? You said you installed Gulp using Yarn before, maybe that's why it's there. If npm is conceived to work differently on that platform, then you should stick to it. Mixing Yarn and npm may be a bad idea. You could try removing that created node_modules directory and the eventual yarn.lock file Yarn creates.

Everything else is beyond my possibilities here. Like I said before, I know close to nothing about Termux and its intricacies. I'm not able to reproduce your issue at the moment either, so best I can do is guess. In this case, the Termux app community can provide you with better support and point you in the right direction.

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

No branches or pull requests

2 participants