ssc-oscar / DRE

MIT License
4 stars 10 forks source link

Updating node #63

Closed sylviesworld closed 3 years ago

sylviesworld commented 3 years ago

@audrism I'm almost done updating the website, but some of the new versions of packages require node >= 12.13.0. We are currently using version 10.20.1. Would it be possible for you to update it? I tried but I don't have the permissions to.

audrism commented 3 years ago

Will do later today

On Thu, Jul 1, 2021, 2:35 AM Dylan Lomax @.***> wrote:

@audrism https://github.com/audrism I'm almost done updating the website, but some of the new versions of packages require node >= 12.13.0. We are currently using version 10.20.1. Would it be possible for you to update it? I tried but I don't have the permissions to.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ssc-oscar/DRE/issues/63, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4NZN2KZ7O4FBH47FRG2RLTVOS2PANCNFSM47TKH7SA .

sylviesworld commented 3 years ago

Just to add to this, you might want to update to either version Node 14 or 16. Version 10 reached the end of active support a year ago and reached the end of security support 2 months ago. 12 leaves security support in 10 months and is already out of active support.

image

audrism commented 3 years ago

Thank you!

Does npm install do the updates or do I need to update ubuntu npm package first?

sylviesworld commented 3 years ago

If you are talking about updating node, here's what I found: image

If you are talking about the packages that I updated: I will make a PR that will include an updated package.json that will tell npm which version of each package to update to. So once you pull that npm update should be all you need to do

audrism commented 3 years ago

I have installed n, upgraded npm but

sudo npm install -g
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/MERN-boilerplate/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/MERN-boilerplate/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ MERN-boilerplate@1.0.0

finally:

sudo npm run start:dev

> MERN-boilerplate@1.0.0 start:dev /home/audris/swsc/DRE
> PORT=3000 node server

internal/modules/cjs/loader.js:1144
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '/home/audris/swsc/DRE/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
sylviesworld commented 3 years ago

I've been getting those warnings about fsevents too. Node is still showing up as version 10.20.1 in my container. For the bcrypt error try: npm rebuild bcrypt

audrism commented 3 years ago
npm -v 
7.19.1

node -v 
v14.17.2

but

npm run start:dev

Require stack:
- /home/audris/swsc/DRE1/node_modules/bcrypt/bcrypt.js
- /home/audris/swsc/DRE1/server/models/User.js
- /home/audris/swsc/DRE1/server/routes/api/sampling.js
- /home/audris/swsc/DRE1/server/routes/index.js
- /home/audris/swsc/DRE1/server/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/audris/swsc/DRE1/node_modules/bcrypt/bcrypt.js:6:16)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/audris/swsc/DRE1/server/models/User.js:2:16)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/audris/swsc/DRE1/server/routes/api/sampling.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/audris/swsc/DRE1/node_modules/bcrypt/bcrypt.js',
    '/home/audris/swsc/DRE1/server/models/User.js',
    '/home/audris/swsc/DRE1/server/routes/api/sampling.js',
    '/home/audris/swsc/DRE1/server/routes/index.js',
    '/home/audris/swsc/DRE1/server/server.js'
  ]
}
sylviesworld commented 3 years ago

image

Is there something I need to do in my container to get the new versions?

audrism commented 3 years ago

Ok, now I realized what you mean: mern docker, right?

sylviesworld commented 3 years ago

Yes. How do I pull new docker image?

sylviesworld commented 3 years ago

Is this the command I need to do with the new dockerfile? docker build {name} .

audrism commented 3 years ago

Docker build .

On Sat, Jul 3, 2021, 8:44 PM Dylan Lomax @.***> wrote:

Is this the command I need to do with the new dockerfile? docker build {name} .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ssc-oscar/DRE/issues/63#issuecomment-873443578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4NZN6M75WEUAYN6KMYGADTV5D5NANCNFSM47TKH7SA .

sylviesworld commented 3 years ago

Alright, I figured it out and now am running on the new versions! I'll work on getting everything working and submit a PR asap