Run learnounode on NodeSchool

Asked 1 years ago, Updated 1 years ago, 96 views

I tried to study at NodeSchool, so I set it up with reference to the following article, but when I run learnyounode, I get the following SyntaxError:

The following steps were taken:

Also, I didn't tamper with the files that I dropped, and the version is still written.
Do you need other procedures?Do I have to update the version?
Please let me know if anyone knows anything.

Reference:
Enhance your JS power with NodeSchool!-Qiita

SyntaxError

const explicit=require('explicit')
^^^^^
SyntaxError: Use of constraint mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous>(/Users/user/.nvm/versions/node/v0.12.7/lib/node_modules/learnyounode/node_modules/workshopper-adventure/index.js:2:20)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

node.js

2022-09-30 21:45

1 Answers

Node.js version is very old.The Qiita article you are referring to is from 2015, and the article that says nvm install 0.12.7 is the recommended version as of 2015.Now in 2020, this is old, and this is why this error has occurred.See Q&A here for the reason for the error itself: node.js does not go through const.

This answer provides a solution.

Looking at the repository of learncode, there seems to be no specific Node.js version specification, so if you're going to get started, you can use the current stable version. Try to use the version of Node.js that https://nodejs.org/ja/ specifies as LTS.At the time of writing this answer, it is 12.16.2

.

For nvm, you can use the command below to install and use a stable version.After installation, check the version with node--version.

nvm install stable --latest-npm
nvm alias default stable


2022-09-30 21:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.