Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from 0.10.0 to 0.11.0 #1169

Closed
ctuxboy opened this issue May 11, 2020 · 21 comments
Closed

Update from 0.10.0 to 0.11.0 #1169

ctuxboy opened this issue May 11, 2020 · 21 comments

Comments

@ctuxboy
Copy link

ctuxboy commented May 11, 2020

It's very strange, but when trying updating 11ty in the project-dir:

$sudo npm update @11ty/eleventy
$eleventy --version
0.10.0

After that trying globally
$sudo npm update @11ty/eleventy -g
$eleventy --version
0.10.0

This is a snippet from package.json:
...

"@11ty/eleventy": {
      "version": "0.10.0",
      "resolved": "https://registry.npmjs.org/@11ty/eleventy/-/eleventy-0.10.0.tgz",

...

Hope someone knows what i'm doing wrong?

@pdehaan
Copy link
Contributor

pdehaan commented May 11, 2020

@ctuxboy What does your terminal say if you try querying npm for the latest version info?

npm info @11ty/eleventy version

# "0.11.0" for me locally on macOS

Or does it work if you try and force latest version using something like:

[sudo] npm i @11ty/eleventy@latest -S

(or -D if you have it as a devDependency in your package.json)

@ctuxboy
Copy link
Author

ctuxboy commented May 11, 2020

@pdehaan thanks a lot for your help!

When typing this command:
$npm info @11ty/eleventy version
shows 0.11.0

I don't know why the 'default' command not works :/
Or maybe a caching issue?

btw, working on a linux container on my Qnap NAS :)

@zachleat
Copy link
Member

Hmm—this might be the weird exception for pre-1.0 semvers. We’re going to 1.0 next to avoid this in the future (among other things).

@zachleat
Copy link
Member

This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

If the response works to solve your problem—great! But if you’re still having problems, do not let the issue’s closing deter you if you have additional questions! Post another comment and I will reopen the issue. Thanks!

@pdehaan
Copy link
Contributor

pdehaan commented May 11, 2020

@ctuxboy What about if you try deleting your local package-lock.json file and try reinstalling Eleventy.
(Sorry, I've never developed on a NAS before)

You could also try creating a new project and npm install @11ty/eleventy and see which version it installs. That might point us to whether it is a caching problem or maybe something else.

@ctuxboy
Copy link
Author

ctuxboy commented May 12, 2020

@ctuxboy What about if you try deleting your local package-lock.json file and try reinstalling Eleventy.
(Sorry, I've never developed on a NAS before)

You could also try creating a new project and npm install @11ty/eleventy and see which version it installs. That might point us to whether it is a caching problem or maybe something else.

  • Remove package-lock.json
  • Trying reinstall 11ty:

See results in screenshot below:

Screenshot 2020-05-12 at 09 13 22

After the reinstall cheking the version:
$eleventy --version
0.10.0

Okay, now installed a test-project:
$ eleventy --version
0.10.0

It installed the wrong 11ty version on both projects :(

PS: the only differents developing on a NAS with linux container, working remote in my LAN, login via ssh for access the linux container (example: ssh user@192.168.0.227)

@pdehaan
Copy link
Contributor

pdehaan commented May 12, 2020

One other weird idea, but looking at your usage above, I’m wondering if you have an older version of Eleventy installed globally (or maybe your PATH magically includes ./node_modules/.bin/.

Does eleventy —-version and ./node_modules/.bin/eleventy —-version return the same thing?
Possibly run npm i @11ty/eleventy -g if you already have it installed globally. Not sure how you’d know if it was already globally installed unless you can run which eleventy or something.


UPDATE: OK, you should be able to see if eleventy is installed globally using npm ls -g --depth=0.

Also, just to confirm that you aren't using some weird custom npm registry which might not have the latest version yet:

npm config get registry
# https://registry.npmjs.org/

@zachleat zachleat reopened this May 12, 2020
@zachleat
Copy link
Member

Are you using npx to run it? This would guarantee to use the local project version. Just running eleventy may use a global version

@ctuxboy
Copy link
Author

ctuxboy commented May 13, 2020

One other weird idea, but looking at your usage above, I’m wondering if you have an older version of Eleventy installed globally (or maybe your PATH magically includes ./node_modules/.bin/.

Does eleventy —-version and ./node_modules/.bin/eleventy —-version return the same thing?
Possibly run npm i @11ty/eleventy -g if you already have it installed globally. Not sure how you’d know if it was already globally installed unless you can run which eleventy or something.

UPDATE: OK, you should be able to see if eleventy is installed globally using npm ls -g --depth=0.

Also, just to confirm that you aren't using some weird custom npm registry which might not have the latest version yet:

npm config get registry
# https://registry.npmjs.org/

In the beginning installing 11ty 6 months ago installed globally and also locally, so if i understand, i want to remove the globally version?

Here you see all the commands:
Screenshot 2020-05-13 at 09 09 44
Screenshot 2020-05-13 at 09 09 35
Screenshot 2020-05-13 at 09 09 17
Screenshot 2020-05-13 at 09 09 03

@ctuxboy
Copy link
Author

ctuxboy commented May 13, 2020

Are you using npx to run it? This would guarantee to use the local project version. Just running eleventy may use a global version

Good tip! I din't know the differents about npm vs npx, thanks for the clarification.
Most following your docs, but when i have issues, then 'trying with npm :-s

@ctuxboy
Copy link
Author

ctuxboy commented May 13, 2020

Okay, uninstall eleventy globally:
$ sudo npm -g uninstall @11ty/eleventy

After that, trying installing locally:
Screenshot 2020-05-13 at 09 28 10

Trying with npm (@zachleat this issues was the reason why i expermenting in the past for installing eleventy with globally/locally, npx/npm)
Screenshot_2020_05_13_at_09_30_24

Following this release notes: https://github.com/11ty/eleventy/releases/tag/v0.11.0

Maybe this can be interesting?
Screenshot 2020-05-13 at 09 41 31

@Ryuno-Ki
Copy link
Contributor

A locally installed eleventy would be called via ./node_modules/.bin/eleventy (or via an alias in your package.json.

@desiredpersona
Copy link

I had same issue on macOS trying to update local copy of Eleventy from v10 to v11.

npx npm-check-updates -u and npm install worked for me.

@pdehaan
Copy link
Contributor

pdehaan commented May 13, 2020

@ctuxboy Yeah, I think the -bash /usr/local/bin/eleventy: No such file or directory error is fair, since it's no longer globally installed.

You'd need to probably do one of the following:

eleventy --version
# "zsh: command not found: eleventy" (because I don't have it installed globally)

npx eleventy --version
# "0.11.0" (because I _DO_ have it installed locally)

$(npm bin)/eleventy --version
# "0.11.0" (where `$(npm bin)` is a shortcut for "./node_modules/.bin")

./node_modules/.bin/eleventy --version
# "0.11.0"

Personally, I prefer just putting "build" and "serve" scripts in my package.json file, like this:

  "scripts": {
    "build": "eleventy",
    "serve": "eleventy --serve",
    ...
  }

And then I can just run npm run build from the Terminal and I know that npm will find the eleventy code in ./node_modules/.bin/. I've never been a fan of globally installed Node modules (mostly for this very reason).

@ctuxboy
Copy link
Author

ctuxboy commented May 13, 2020

Hi guys,
Sorry for all my (stupid )questions, i learn a lot with this issue and thanks for all the help!
I really appreciated it!!!
I think all this stuff is basic nodejs/npm commands, reading a book about nodejs, but i learn a lot more here with you guys :)

Happy that latest version installed correctly!
eleventy console

@pdehaan thanks for the tip about the 'scripts' in package.json, adding the snippet, works really well with build and serve, and more comfortable :)

(sorry for my poor english!)

@Ryuno-Ki
Copy link
Contributor

Okay, so it looks like, the local installation already works.
Let's find out, whether you have some leftovers of the global one:

which eleventy should give you a path to where the global installation was found.
For some reason, it would look in /usr/local/bin for it after all …

@pdehaan
Copy link
Contributor

pdehaan commented May 14, 2020

Interesting, it looks like you were successfully installing v0.11.0 a couple days ago, per your screenshot in #1169 (comment), I just don't think we noticed the local-vs-global install issue yet:

81649600-db7d8980-9430-11ea-9160-b383b9a80dec_png__1369×777_

@ctuxboy
Copy link
Author

ctuxboy commented May 14, 2020

which eleventy

which eleventy gives no results:
Screenshot 2020-05-14 at 20 38 35

@Ryuno-Ki
Copy link
Contributor

Then, that means, you no longer have a global installation! 🎉

But perhaps, you'd want to have the ability to use the CLI without relying on npx.
If this is the only project using eleventy on that machine, you could add this line to a $HOME/.profile file (create that file if it does not exist yet):

PATH=$HOME/webapps/innood/node_modules/.bin:$PATH

Close the terminal and open a new one.
Then, which eleventy should show you the pass to the locally installed eleventy CLI.

@zachleat
Copy link
Member

This seems resolved—I really appreciate all y’all helping here! ❤️

@ctuxboy
Copy link
Author

ctuxboy commented May 15, 2020

Then, that means, you no longer have a global installation! 🎉

But perhaps, you'd want to have the ability to use the CLI without relying on npx.
If this is the only project using eleventy on that machine, you could add this line to a $HOME/.profile file (create that file if it does not exist yet):

PATH=$HOME/webapps/innood/node_modules/.bin:$PATH

Close the terminal and open a new one.
Then, which eleventy should show you the pass to the locally installed eleventy CLI.

Sorry for the delay.

Yeah, that works perfect! Thanks for the useful tip!
Screenshot 2020-05-16 at 00 36 35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants