Skip to main content
added 376 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. nvm alias default v13.14.0
  4. Update npm with npm i -g [email protected]
  5. run: npm update
  6. you can use npm list to see the hierarchy of dependencies too. (For some reason node 15 + latest npm defaults to only showing first level of depth - a la package.json. That renders default command pointless! You can append --depth=n) to make command more useful again).
  7. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here


Footnote: Another thing when you get to the JSX section, check out my answer here: https://stackoverflow.com/a/65430910/495157

When you get to:

  • Advanced Component Configuration with props, state, and children. P182+, node version 13 isn't supported for some of the dependencies there.
  • Will add findings for that later too.

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. Update npm with npm i -g [email protected]
  4. run: npm update
  5. you can use npm list to see the hierarchy of dependencies too. (For some reason node 15 + latest npm defaults to only showing first level of depth - a la package.json. That renders default command pointless! You can append --depth=n) to make command more useful again).
  6. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. nvm alias default v13.14.0
  4. Update npm with npm i -g [email protected]
  5. run: npm update
  6. you can use npm list to see the hierarchy of dependencies too. (For some reason node 15 + latest npm defaults to only showing first level of depth - a la package.json. That renders default command pointless! You can append --depth=n) to make command more useful again).
  7. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here


Footnote: Another thing when you get to the JSX section, check out my answer here: https://stackoverflow.com/a/65430910/495157

When you get to:

  • Advanced Component Configuration with props, state, and children. P182+, node version 13 isn't supported for some of the dependencies there.
  • Will add findings for that later too.
added 210 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. Update npm with npm i -g [email protected]
  4. run: npm update
  5. you can use npm list to see the hierarchy of dependencies too. (For some reason node 15 + latest npm defaults to only showing first level of depth - a la package.json. That renders default command pointless! You can append --depth=n) to make command more useful again).
  6. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. Update npm with npm i -g [email protected]
  4. run: npm update
  5. you can use npm list to see the hierarchy of dependencies too.
  6. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. Update npm with npm i -g [email protected]
  4. run: npm update
  5. you can use npm list to see the hierarchy of dependencies too. (For some reason node 15 + latest npm defaults to only showing first level of depth - a la package.json. That renders default command pointless! You can append --depth=n) to make command more useful again).
  6. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here

added 59 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. Update npm with npm i -g [email protected]
  4. run: npm update
  5. you can use npm list to see the hierarchy of dependencies too.
  6. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

*Note in v14 of node and newer npm you'd have npm audit too - but there issues requiring (update of chokidar and some others packages) to a version. live-server hasn't been updated to support the newer library versions.

See similar post here

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13 of Node (*v14+ creates other headaches)
  3. run: npm update
  4. you can use npm list to see the hierarchy of dependencies too.

*Note in v14 of node and newer npm you'd have npm audit too - but there issues requiring (update of chokidar and some others packages) to a version. live-server hasn't been updated to support the newer library versions.

See similar post here

I had this issue using live-server (using the Fullstack React book):

I kept getting:

Error: Cannot find module './disable-browser-cache.js' 
...

I had to tweak my package.json

  • From:

    "scripts": { ... "server": "live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js" ... } "scripts": {

  • To:

    ... "server": "live-server public --host=localhost --port=3000 --middleware=../../disable-browser-cache.js" ... }

Notice relative paths seem broken/awkward... ./ becomes ../../

I found the issue here

Also if anyone follows along with that book:

  1. change devDependencies in packages.json to:

"live-server": "https://github.com/tapio/live-server/tarball/master"

Currently that upgrades from v1.2.0 to v1.2.1

  1. It's good to use nvm.
  2. It's best to install v13.14 of Node (*v14+ creates other headaches) nvm install v13.14.0
  3. Update npm with npm i -g [email protected]
  4. run: npm update
  5. you can use npm list to see the hierarchy of dependencies too.
  6. you can use npm audit too. There issues requiring (update of chokidar and some others packages) to newer versions. live-server hasn't been updated to support the newer corresponding node v 14 library versions.

See similar post here

added 10 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97
Loading
added 131 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97
Loading
added 131 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97
Loading
added 653 characters in body
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97
Loading
Source Link
JGFMK
  • 8.8k
  • 4
  • 60
  • 97
Loading