question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node.js sample from node devfile contains node_modules in the source code

See original GitHub issue

Describe the bug

node.js sample from node devfile(https://github.com/eclipse/che-devfile-registry/blob/master/devfiles/nodejs/devfile.yaml#L10) contains node_modules folder in the source code It’s looks strange . In most case node developers exclude such folder from source code and use package.lock.json or yarn.lock to freeze transitive dependencies, or to use transitive dependencies without security vulnerabilities.

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Create new workspace from node devfile “NodeJS Express Web Application”
  2. Open source code project nodejs-web-app

Expected behavior

Sample should has node_modules excluded in the .gitignore file and we should have a command in the devfile to get node dependencies (‘npm install’) or ‘npm install’ should be embedded to the application start devfile command.

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Installation method

  • chectl
  • che-operator
  • minishift-addon
  • I don’t know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: please specify

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
slemeurcommented, Aug 1, 2019

It is useful, but I don’t think it is high priority, but as it’s something fairly quick to handle we could take it.

1reaction
amisevskcommented, Jul 31, 2019

@slemeur I believe we could remove node_modules since we own the repo, I was planning on opening a PR for that and other changes to sample projects at some point (e.g. the web-java-spring sample project readme is out of date.

Do you think cleaning up sample projects is something useful for 7.0.0?

Read more comments on GitHub >

github_iconTop Results From Across the Web

node/modules.md at main · nodejs/node - GitHub
Node.js has two module systems: CommonJS modules and ECMAScript modules. ... include the "type" field, even in packages where all sources are CommonJS....
Read more >
How To Use Node.js Modules with npm and package.json
We begin this tutorial by setting up the example project—a fictional Node.js locator module that gets the user's IP address and returns the ......
Read more >
How to include scripts located inside the node_modules folder?
If you were using express with nodejs, a static route is as simple as this: app.use('/scripts', express.static(__dirname + '/node_modules/bootstrap/dist/'));.
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
The package consists of the folder containing the package.json file and all ... include the "type" field, even in packages where all sources...
Read more >
Set Up a GitHub Project with node_module - Pluralsight
The npx command is bundled with the node.js package, and, apart from npx ... A node_modules directory contains all the React dependencies ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found