GithubHelp home page GithubHelp logo

Comments (3)

kevmoo avatar kevmoo commented on May 31, 2024

The code in question is here:

/// The path to the root directory of the SDK.
final String _sdkDir = (() {
// The Dart executable is in "/path/to/sdk/bin/dart", so two levels up is
// "/path/to/sdk".
var aboveExecutable = p.dirname(p.dirname(Platform.resolvedExecutable));
assert(FileSystemEntity.isFileSync(p.join(aboveExecutable, 'version')));
return aboveExecutable;
})();
final String dartPath = p.join(_sdkDir, 'bin', 'dart');
final String pubPath =
p.join(_sdkDir, 'bin', Platform.isWindows ? 'pub.bat' : 'pub');

We effectively assume the following structure for the SDK directory...

  • version
  • bin/pub
  • bin/dart

Do you see this out directory anywhere?
Are dart and pub in the same directory?

from webdev.

Jack0fAll avatar Jack0fAll commented on May 31, 2024

I updated my first post on this thread so you can see the link I was referring to for the guide for installing Dart.
Upon rereading that, I saw the problem.

I've been using dart-sdk/sdk/sdk, which has bin/pub, bin/dart, but not version.
I should have been using dart-sdk/sdk/out/ReleaseX64/dart-sdk, which has bin/pub, bin/dart, and version.

So, the solution was to change my path for Dart from
export PATH=/home/myUserName/development/dart/dart-sdk/sdk/sdk/bin:$PATH
to
export PATH=/home/myUserName/development/dart/dart-sdk/sdk/out/ReleaseX64/dart-sdk/bin:$PATH.

After doing this, webdev serve worked!

In conclusion, this is not a problem with webdev. I'm sorry for any inconvenience.
Potentially, we could add a more detailed error message when the above error message is triggered that automatically searches for another dart-sdk directory in the current dart-sdk directory and suggests you change your path to use the deeper (correct) directory. That could help a less experienced Linux user, but may be too specific of a problem to worry about adding an error message for.

Should I suggest they add a section on updating the PATH to Building Dart on CentOS, Red Hat, Fedora and Amazon Linux AMI?

Thank you for your time.

BTW (for any future/lurking readers), to change path variables in Fedora 28, it's best to make or edit a file in etc/profile.d
For example, I use /etc/profile.d/myPathVars.sh:

# 08/16/2018
# Dart and pub:
export PATH=/home/myUserName/development/dart/dart-sdk/sdk/out/ReleaseX64/dart-sdk/bin:$PATH

from webdev.

CarreraPHP avatar CarreraPHP commented on May 31, 2024

@Jack0fAll , Can you close this Issue?

from webdev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.