nearst / laconia

Create well-crafted serverless applications, effortlessly.
http://laconiajs.io
Apache License 2.0
325 stars 30 forks source link

lerna error while testing #829

Open Samridhi-98 opened 2 years ago

Samridhi-98 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior. MVCE would definitely help.

Screenshot

image

hugosenari commented 2 years ago

Can you please provide more information about your environment? cygwin, git-bash, WSL or other?

Samridhi-98 commented 2 years ago

Can you please provide more information about your environment? cygwin, git-bash, WSL or other?

git-bash and Powershell I tried running the above command in both and got the same error.

hugosenari commented 2 years ago

Your previous image has some more information

image

You may be the only person with this setup that could properly reproduce and fix this bug.

I found this issue that could be related. But my bet would be with the escaping slash.

Please try this change in package.json

-    "test:packagelint": "lerna exec npmPkgJsonLint -- --quiet -c \$LERNA_ROOT_PATH/.npmpackagejsonlintrc.json .",
+    "test:packagelint": "lerna exec npmPkgJsonLint -- --quiet -c \"${LERNA_ROOT_PATH}\"/.npmpackagejsonlintrc.json .",

or this

-    "test:packagelint": "lerna exec npmPkgJsonLint -- --quiet -c \$LERNA_ROOT_PATH/.npmpackagejsonlintrc.json .",
+    "test:packagelint": "lerna exec npmPkgJsonLint -- --quiet -c '${LERNA_ROOT_PATH}/.npmpackagejsonlintrc.json' .",

and run:

npm run test:packagelint
Samridhi-98 commented 2 years ago

@hugosenari still getting the same error. Couldn't find the path. Is it node version issue? (mine is 14.17.4)

image

image

ritik307 commented 2 years ago

The problem is with window's file path which is different from that of Linux, which I guess you guys have already figured out. So, now the solution would be (at least what I think is) to use WSL2 for running your project in windows. The steps are simple

  1. Install WSL2 in your windows
  2. Install node inside your WSL2.
  3. Locate to the directory where your project is (probably inside the mnt directory) and then run the project with the cmd provided.

Following is the link on how to install WSL2 and node. How to install WSL2 How setup node inside WSL2