Home>

As the title says, I would like to build an environment for Node.js on Mac Book Pro, but I am having troubles because I can not do well.

【Current status】
I was proceeding with reference to the following sites.
2020 edition, getting started with Node.js! Carefully explain how to use ~ environment construction

Last login: Sun Aug 23 21:19:25 on ttys000
USERnoMBP:~ Tatsuro_Sugi$-bash
-bash: -bash: command not found
USERnoMBP:~ Tatsuro_Sugi$curl -L git.io/nodebrew | perl – setup
  % Total% Received %Xferd Average Speed ​​Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 Can't open perl script "–": No such file or directory
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
 66 24634 66 16452 0 0 4273 0 0:00:05 0:00:03 0:00:02 30808
curl: (23) Failed writing body (0 != 1371)
USERnoMBP:~ Tatsuro_Sugi$export PATH=$HOME/.nodebrew/current/bin:$PATH
USERnoMBP:~ Tatsuro_Sugi$nodebrew -v
nodebrew 1.0.1
Usage:
    nodebrew help Show this message
    nodebrew install<version>Download and install<version>(from binary)
    nodebrew compile<version>Download and install<version>(from source)
    nodebrew install-binary<version>Alias ​​of `install` (For backward compatibility)
    nodebrew uninstall<version>Uninstall<version>
    nodebrew use<version>Use<version>
    nodebrew list List installed versions
    nodebrew ls Alias ​​for `list`
    nodebrew ls-remote List remote versions
    nodebrew ls-all List remote and installed versions
    nodebrew alias<key><value>Set alias
    nodebrew unalias<key>Remove alias
    nodebrew clean<version>| all Remove source file
    nodebrew selfupdate Update nodebrew
    nodebrew migrate-package<version>Install global NPM packages contained in<version>to current version
    nodebrew exec<version>--<command>Execute<command>using specified<version>
Example:
    # install
    nodebrew install v8.9.4
    # use a specific version number
    nodebrew use v8.9.4
USERnoMBP:~ Tatsuro_Sugi$nodebrew install-binary v8.9.1
v8.9.1 is already installed
USERnoMBP:~ Tatsuro_Sugi$nodebrew ls
v8.9.1
v14.8.0
current: v14.8.0
USERnoMBP:~ Tatsuro_Sugi$


If i enter nodebrew (the 5th line from the bottom), current: v14.8.0 is displayed, so I think that you have installed it.

However, if you enter node. to enter REPL mode and then enter console.log('hello world'), the following will be displayed.

>console.log(‘hello world’)
console.log(‘hello world’)

Uncaught SyntaxError: Invalid or unexpected token
>


Why is this happening?
I am very sorry for the elementary question, but I would appreciate it if you could teach me.
Thanks for your cooperation.

  • Answer # 1

    Why is this happening?

    The quotes are incorrect.‘Hello world’not'hello world'Please

  • Answer # 2

    It was my mistake.
    Thank you very much.