Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Does not add all needed Feathers dependencies #90

Closed
binury opened this issue Jun 7, 2017 · 16 comments
Closed

Does not add all needed Feathers dependencies #90

binury opened this issue Jun 7, 2017 · 16 comments

Comments

@binury
Copy link

binury commented Jun 7, 2017

Note: Please include Node.js version (node -v) and npm version (npm -v) when reporting on this issue.

Steps to reproduce

❯ fgtest feathers g app .
? Project name fgtest
? Description
? What folder should the source files live in? src
? Which package manager are you using (has to be installed globally)? Yarn
? What type of API are you making? (Press <space> to select, <a> to toggle all, <i> to inverse selection)REST, Realtime via Socket.io
   create package.json
   create config/default.json
   create LICENSE
   create public/favicon.ico
   create public/index.html
   create .editorconfig
   create .eslintrc.json
   create .npmignore
   create src/app.hooks.js
   create src/hooks/logger.js
   create src/index.js
   create src/middleware/index.js
   create src/services/index.js
   create .gitignore
   create README.md
   create src/app.js
   create test/app.test.js
   create config/production.json
yarn add v0.24.6
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 200 new dependencies.
❯ fgtest [1m 2s] yarn start
yarn start v0.24.6
$ node src/
module.js:487
    throw err;
    ^

Error: Cannot find module 'winston'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/teddy/code/scratch-projects/fgtest/src/index.js:2:16)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
error Command failed with exit code 1.

❯ fgtest cat package.json
{
  "name": "fgtest",
  "description": "",
  "version": "0.0.0",
  "homepage": "",
  "main": "src",
  "keywords": [
    "feathers"
  ],
  "author": {
    "name": "Bin Ury",
    "email": "bin.ury@tuta.io"
  },
  "contributors": [],
  "bugs": {},
  "directories": {
    "lib": "src"
  },
  "engines": {
    "node": ">= 6.0.0",
    "yarn": ">= 0.18.0"
  },
  "scripts": {
    "test": "npm run eslint && npm run mocha",
    "eslint": "eslint src/. test/. --config .eslintrc.json",
    "start": "node src/",
    "mocha": "mocha test/ --recursive"
  },
  "dependencies": {
    "eslint": "^3.19.0",
    "mocha": "^3.4.2",
    "request": "^2.81.0",
    "request-promise": "^4.2.1"
  }
}

System configuration

❯ fgtest feathers g app .
? Project name fgtest
? Description
? What folder should the source files live in? src
? Which package manager are you using (has to be installed globally)? Yarn
? What type of API are you making? (Press <space> to select, <a> to toggle all, <i> to inverse selection)REST, Realtime via Socket.io

Module versions (especially the part that's not working):
Feathers-cli 2.0.5
yarn 0.24.6
NodeJS version:
8.0.0
Operating System:
MacOS 10.12.6

@binury
Copy link
Author

binury commented Jun 7, 2017

It should be noted that this also occurs sometimes when new services with extra dependencies are generated.

@ekryski
Copy link
Member

ekryski commented Jun 7, 2017

I wonder if updating yeoman-env did something funky?? 1a84cf9

@teddy-error would you be able to quickly test if this works with feathers-cli v2.0.4?

@marshallswain
Copy link
Member

marshallswain commented Jun 7, 2017

Maybe this is related to using npm@5. I reported a similar error with the DoneJS generator: donejs/donejs#959 Maybe related to the lock file?

@daffl
Copy link
Member

daffl commented Jun 7, 2017

I don't think it's the Yeoman environment, that PR hasn't been published yet. I'll re-run the tests for the Generator with Node 8, they should be failing already then.

@daffl
Copy link
Member

daffl commented Jun 8, 2017

I just installed Node 8 using nvm and can't reproduce the issue. It looks like your package.json got somehow mangled. Is this reproducible for anybody else?

@luiz-filipe
Copy link

luiz-filipe commented Jun 9, 2017

Just to let you know the same happened to me. Created a new app using the feathers-cli and tried to run the tests straight away:

Output

$ npm run test

> shout@0.0.0 test /Users/filipe/Develop/the-vitamin/api
> npm run eslint && npm run mocha


> shout@0.0.0 eslint /Users/filipe/Develop/the-vitamin/api
> eslint src/. test/. --config .eslintrc.json


> shout@0.0.0 mocha /Users/filipe/Develop/the-vitamin/api
> mocha test/ --recursive

module.js:487
    throw err;
    ^

Error: Cannot find module 'serve-favicon'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/filipe/Develop/the-vitamin/api/src/app.js:2:17)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/filipe/Develop/the-vitamin/api/test/app.test.js:3:13)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at /Users/filipe/Develop/the-vitamin/api/node_modules/mocha/lib/mocha.js:230:27
    at Array.forEach (native)
    at Mocha.loadFiles (/Users/filipe/Develop/the-vitamin/api/node_modules/mocha/lib/mocha.js:227:14)
    at Mocha.run (/Users/filipe/Develop/the-vitamin/api/node_modules/mocha/lib/mocha.js:495:10)
    at Object.<anonymous> (/Users/filipe/Develop/the-vitamin/api/node_modules/mocha/bin/_mocha:469:18)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

Generated package.json

{
  "name": "shout",
  "version": "0.0.0",
  "homepage": "",
  "main": "src",
  "keywords": [
    "feathers"
  ],
  "contributors": [],
  "bugs": {},
  "directories": {
    "lib": "src"
  },
  "engines": {
    "node": ">= 6.0.0",
    "yarn": ">= 0.18.0"
  },
  "scripts": {
    "test": "npm run eslint && npm run mocha",
    "eslint": "eslint src/. test/. --config .eslintrc.json",
    "start": "node src/",
    "mocha": "mocha test/ --recursive"
  },
  "dependencies": {
    "eslint": "^3.19.0",
    "feathers-mongoose": "^5.1.0",
    "mocha": "^3.4.2",
    "mongoose": "^4.10.5",
    "request": "^2.81.0",
    "request-promise": "^4.2.1"
  }
}

Environment

  • Node: 8.1.0
  • feathers-cli: 2.0.5
  • MacOS: 10.12.5
  • Yarn: 0.23.4

@luiz-filipe
Copy link

luiz-filipe commented Jun 9, 2017

So I uninstalled feathers-cli 2.0.5, installed 2.0.4 and the generated app worked fine, but the mysterious part is that after reinstalling 2.0.5 and regenerating the app with it, it works fine now.

I'm confused.

package.json of the app generated after reinstalling 2.0.5

{
  "name": "temp",
  "description": "",
  "version": "0.0.0",
  "homepage": "",
  "main": "src",
  "keywords": [
    "feathers"
  ],
  "contributors": [],
  "bugs": {},
  "directories": {
    "lib": "src"
  },
  "engines": {
    "node": ">= 6.0.0",
    "yarn": ">= 0.18.0"
  },
  "scripts": {
    "test": "npm run eslint && npm run mocha",
    "eslint": "eslint src/. test/. --config .eslintrc.json",
    "start": "node src/",
    "mocha": "mocha test/ --recursive"
  },
  "dependencies": {
    "body-parser": "^1.17.2",
    "compression": "^1.6.2",
    "cors": "^2.8.3",
    "eslint": "^3.19.0",
    "feathers": "^2.1.3",
    "feathers-configuration": "^0.4.1",
    "feathers-errors": "^2.8.1",
    "feathers-hooks": "^2.0.1",
    "feathers-hooks-common": "^3.5.1",
    "feathers-mongodb": "^2.9.0",
    "feathers-rest": "^1.7.3",
    "helmet": "^3.6.1",
    "mocha": "^3.4.2",
    "mongodb": "^2.2.28",
    "request": "^2.81.0",
    "request-promise": "^4.2.1",
    "serve-favicon": "^2.4.3",
    "winston": "^2.3.1"
  }
}

@daffl
Copy link
Member

daffl commented Jun 9, 2017

It's still strange because the devDependencies (mocha, eslint) ended up in the normal dependencies which I did notice as well. I suspect it's either something with Node 8 or something that changed with Yeoman.

@daffl
Copy link
Member

daffl commented Jun 10, 2017

The devDependencies problem has been fixed. If the missing dependencies issue is intermittent I don't think there is too much we can do but we can look into it more if it persists for more people (after reinstalling).

@mericano1
Copy link

mericano1 commented Oct 4, 2017

I am having the same issue with › feathers --version 2.3.7

my package.json does not have any dependencies, only devDependencies. Here is what was generated

  "name": "calendar-brain",
  "description": "it's the thought that counts",
  "version": "0.0.0",
  "homepage": "",
  "main": "src",
  "keywords": [
    "feathers"
  ],
  "author": {
    "name": "asalvadore",
  },
  "contributors": [],
  "bugs": {},
  "directories": {
    "lib": "src",
    "test": "test/"
  },
  "engines": {
    "node": ">= 6.0.0",
    "yarn": ">= 0.18.0"
  },
  "scripts": {
    "test": "npm run eslint && npm run mocha",
    "eslint": "eslint src/. test/. --config .eslintrc.json",
    "start": "node src/",
    "mocha": "mocha test/ --recursive"
  },
  "devDependencies": {
    "eslint": "^4.8.0",
    "mocha": "^4.0.0",
    "request": "^2.83.0",
    "request-promise": "^4.2.2"
  }
}

@marshallswain
Copy link
Member

Please include Node.js version (node -v) and npm version (npm -v) when reporting on this issue. I'm pretty sure the behavior of this issue is independent of the feathers-cli, itself.

@mericano1
Copy link

mericano1 commented Oct 4, 2017

Sorry, always forget those.

› node -v
v8.6.0
› npm -v
5.4.2

@ulfmaier
Copy link

ulfmaier commented Oct 7, 2017

Happened to me too. Had only devDependencies and no dependencies.

Deleted the project folder and let it generate again and the dependencies where there as expected. I did not update / reinstall / ... anything before the 2nd try.

Settings used:

feathers generate app
? Project name feathers-app
? Description 
? What folder should the source files live in? src
? Which package manager are you using (has to be installed globally)? Yarn
? What type of API are you making? REST, Realtime via Socket.io

yarn 1.1.0
npm 5.4.2
node v8.6.0
feathers-cli 2.3.7
macOS 10.13

@daffl
Copy link
Member

daffl commented Oct 7, 2017

If someone can create a reproducible example we can look into it but if it is only intermittent I am not sure there is much we can do.

@pepe
Copy link

pepe commented Oct 9, 2017

Hello, same for me with the same config as @ulfmaier :

yarn 1.1.0
npm 5.4.2
node v8.6.0
feathers-cli 2.3.7
macOS 10.13

And for me, it is always the case, not only intermittent. I uninstalled node and yarn and installed them back with no luck. Strange thing is, that puppeteer package is installed at the end of the installation. Which I was playing with lately.

But even stranger when I choose npm as installation method, everything works great.

I am afraid it only adds to the confusion, I just wanted to share my experience.

@Cengkaruk
Copy link

Same with @pepe when i choose npm, everything works well.

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

9 participants