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.

Unable to find packages.json on Windows Manual Install

See original GitHub issue

Describe the bug

I grabbed the latest changeset, d7ed71e, on the develop branch. I think issue #4787 has been resolved, but I’m getting an error that packages.json cannot be found.

Relevant snippet:

[ERROR] npm - npm ERR! error in C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\node_modules\ep_etherpad-lite: ENOENT: no such file or directory, open 'C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\node_modules\ep_etherpad-lite\package.json'

The file ep_etherpad-lite exists and the contents are “…/src”. If use a file explorer to navigate up one level and into /src, I find packages.json. I don’t think Windows supports using a file for path redirection this way. I tried replacing ep_etherpad-lite with a shortcut, but that didn’t work. I deleted ep_etherpad-lite, created a folder in its place and copied packages.json into this folder: that caused this issue to go away and start.bat seems to run successfully.

However, start.bat auto exits and returns to the command line and there doesn’t appear to be a server running in the background. I don’t know if that is a side effect of the change I described above. I then tried using node src/node/server.js to start the server instead, but auto-quits in the same way.

  1. Here’s the complete log from before I started playing with the ep_etherpad-lite file.
C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop>start.bat

C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop>node src\node\server.js
[2021-02-16 19:00:20.780] [DEBUG] console - Running on Node v14.15.5 (minimum required Node version: 10.17.0)
[2021-02-16 19:00:20.793] [INFO] console - All relative paths will be interpreted relative to the identified Etherpad base dir: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop
[2021-02-16 19:00:20.794] [INFO] console - Random string used for versioning assets: 04155d40
[2021-02-16 19:00:20.795] [DEBUG] AbsolutePaths - Relative path "settings.json" can be rewritten to "C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\settings.json"
[2021-02-16 19:00:20.796] [DEBUG] AbsolutePaths - Relative path "credentials.json" can be rewritten to "C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\credentials.json"
[2021-02-16 19:00:20.797] [WARN] console - No settings file found in C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\settings.json. Continuing using defaults!
[2021-02-16 19:00:20.797] [INFO] console - No credentials file found in C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\credentials.json. Ignoring.
[2021-02-16 19:00:20.798] [WARN] console - No "skinName" parameter found. Please check out settings.json.template and update your settings.json. Falling back to the default "colibris".
[2021-02-16 19:00:20.799] [INFO] console - Using skin "colibris" in dir: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\static\skins\colibris
[2021-02-16 19:00:20.799] [INFO] console - Session key file "C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\SESSIONKEY.txt" not found. Creating with random contents.
[2021-02-16 19:00:20.800] [WARN] console - DirtyDB is used. This is not recommended for production. File location: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\var\dirty.db
[2021-02-16 19:00:21.142] [INFO] server - Starting Etherpad...
[2021-02-16 19:00:21.180] [INFO] runNpm - Executing command: npm ls --long --json --depth=0
[2021-02-16 19:00:21.330] [INFO] runNpm - npm --version: 6.14.11
[2021-02-16 19:00:21.615] [ERROR] npm - npm ERR! error in C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\node_modules\ep_etherpad-lite: ENOENT: no such file or directory, open 'C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\node_modules\ep_etherpad-lite\package.json'
[2021-02-16 19:00:21.623] [ERROR] runNpm - npm command failed: npm ls --long --json --depth=0
[2021-02-16 19:00:21.624] [ERROR] server - Error occurred while starting Etherpad
[2021-02-16 19:00:21.625] [ERROR] server - Error: Command exited non-zero: npm ls --long --json --depth=0
    at exports (C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\node\utils\run_cmd.js:71:25)
    at exports (C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\node\utils\run_npm.js:25:13)
    at Object.exports.getPackages (C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\static\js\pluginfw\plugins.js:73:14)
    at Object.exports.update (C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\static\js\pluginfw\plugins.js:56:34)
    at Object.exports.start (C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\node\server.js:137:19)
[2021-02-16 19:00:21.625] [INFO] server - Exiting...
[2021-02-16 19:00:21.626] [INFO] server - Waiting for Node.js to exit...
  1. Log from after I deleted the ep_etherpad-lite file and copied packages.json into a new folder in its place.
C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop>node ./src/node/server.js
[2021-02-16 19:34:11.334] [DEBUG] console - Running on Node v12.20.2 (minimum required Node version: 10.17.0)
[2021-02-16 19:34:11.348] [INFO] console - All relative paths will be interpreted relative to the identified Etherpad base dir: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop
[2021-02-16 19:34:11.349] [INFO] console - Random string used for versioning assets: 5a4d5cee
[2021-02-16 19:34:11.349] [DEBUG] AbsolutePaths - Relative path "settings.json" can be rewritten to "C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\settings.json"
[2021-02-16 19:34:11.350] [DEBUG] AbsolutePaths - Relative path "credentials.json" can be rewritten to "C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\credentials.json"
[2021-02-16 19:34:11.350] [WARN] console - No settings file found in C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\settings.json. Continuing using defaults!
[2021-02-16 19:34:11.351] [INFO] console - No credentials file found in C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\credentials.json. Ignoring.
[2021-02-16 19:34:11.351] [WARN] console - No "skinName" parameter found. Please check out settings.json.template and update your settings.json. Falling back to the default "colibris".
[2021-02-16 19:34:11.352] [INFO] console - Using skin "colibris" in dir: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\src\static\skins\colibris
[2021-02-16 19:34:11.352] [INFO] console - Session key loaded from: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\SESSIONKEY.txt
[2021-02-16 19:34:11.352] [WARN] console - DirtyDB is used. This is not recommended for production. File location: C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e\etherpad-lite-develop\var\dirty.db
[2021-02-16 19:34:11.694] [INFO] server - Starting Etherpad...
[2021-02-16 19:34:11.731] [INFO] runNpm - Executing command: npm ls --long --json --depth=0
[2021-02-16 19:34:11.875] [INFO] runNpm - npm --version: 6.14.11
[2021-02-16 19:34:12.178] [INFO] runNpm - Successfully ran command: npm ls --long --json --depth=0
[2021-02-16 19:34:12.178] [INFO] server - Installed plugins:
[2021-02-16 19:34:12.179] [INFO] server - Etherpad is running

To Reproduce

  1. I downloaded changeset d7ed71e from the develop branch.
  2. Executed InstallOnWindows.bat (no reported errors).
  3. Executed start.bat and the above error was reported.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:83 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
webzwo0icommented, Feb 25, 2021

Interesting. The error from @alexeisenhart with rjquery is thrown from pad.html (before ace.js runs) while your error seems to be thrown later when initializing Ace2Editor.

1reaction
JohnMcLearcommented, Feb 24, 2021

Wow well done mate

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - npm can't find package.json
I think, npm init will create your missing package.json file. It works for me for the same case.
Read more >
Package manager cannot find package in offline resources
1. Open Visual Studio, go to "Debug" --> "Options.." ... 3. Click on "Clear All Nuget Cache(s)" and wait for it to clear....
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.
Read more >
Install and use a NuGet package in Visual Studio ...
From the Browse tab, search for Newtonsoft.Json, select Newtonsoft.Json in the list, and then select Install. Screenshot showing the NuGet ...
Read more >
Install and manage packages in Visual Studio using the ...
For Visual Studio 2015, if you're missing the NuGet Package Manager, check Tools > Extensions and Updates and search for the NuGet Package...
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